public class AmazonImpl extends AbstractProvider
COUNTRY, DOB, EMAIL, EXT_NAMESPACE, FIRST_NAME, FULL_NAME, GENDER, LANGUAGE, LAST_NAME, NICK_NAME, POSTCODE| Constructor and Description |
|---|
AmazonImpl(OAuthConfig providerConfig)
Stores configuration for the provider
|
| Modifier and Type | Method and Description |
|---|---|
Response |
api(String url,
String methodType,
Map<String,String> params,
Map<String,String> headerParams,
String body)
Makes HTTP request to a given URL.It attaches access token in URL.
|
AccessGrant |
getAccessGrant()
Retrieves the AccessGrant object.
|
List<Contact> |
getContactList()
Gets the list of contacts of the user and their email.
|
String |
getLoginRedirectURL(String successUrl)
This is the most important action.
|
protected OAuthStrategyBase |
getOauthStrategy()
Returns the OAuthStrategyBase of a provider.
|
protected List<String> |
getPluginsList()
Returns the list of plugins of a provider.
|
String |
getProviderId()
Retrieves the provider id
|
Profile |
getUserProfile()
Retrieves the user profile.
|
void |
logout()
Logout
|
void |
setAccessGrant(AccessGrant accessGrant)
Stores access grant for the provider
|
void |
setPermission(Permission p) |
Response |
updateStatus(String msg)
Updates the status on the chosen provider if available.
|
Response |
uploadImage(String message,
String fileName,
InputStream inputStream)
Updates the image and message on the chosen provider if available.
|
Profile |
verifyResponse(Map<String,String> requestParams)
Verifies the user when the external provider redirects back to our
application.
|
getPlugin, getPluginsScope, isSupportedPlugin, refreshToken, registerPluginspublic AmazonImpl(OAuthConfig providerConfig) throws Exception
providerConfig - It contains the configuration of application like consumer key
and consumer secretExceptionpublic void setAccessGrant(AccessGrant accessGrant) throws AccessTokenExpireException, SocialAuthException
accessGrant - It contains the access token and other informationExceptionAccessTokenExpireExceptionSocialAuthExceptionpublic String getLoginRedirectURL(String successUrl) throws Exception
Exceptionpublic Profile verifyResponse(Map<String,String> requestParams) throws Exception
requestParams - request parameters, received from the providerExceptionpublic Response updateStatus(String msg) throws Exception
AuthProvidermsg - Message to be shown as user's statusExceptionpublic List<Contact> getContactList() throws Exception
AuthProviderExceptionpublic void logout()
AuthProviderpublic void setPermission(Permission p)
p - Permission object which can be Permission.AUHTHENTICATE_ONLY,
Permission.ALL, Permission.DEFAULTpublic Response api(String url, String methodType, Map<String,String> params, Map<String,String> headerParams, String body) throws Exception
url - URL to make HTTP request.methodType - Method type can be GET, POST or PUTparams - Parameter need to pass with requestheaderParams - Parameters need to pass as Header Parametersbody - Request BodyExceptionpublic Profile getUserProfile() throws Exception
AuthProviderExceptionpublic AccessGrant getAccessGrant()
AuthProviderpublic String getProviderId()
AuthProviderpublic Response uploadImage(String message, String fileName, InputStream inputStream) throws Exception
AuthProvidermessage - Status MessagefileName - Image file nameinputStream - Input Stream of imageExceptionprotected List<String> getPluginsList()
AbstractProvidergetPluginsList in class AbstractProviderprotected OAuthStrategyBase getOauthStrategy()
AbstractProvidergetOauthStrategy in class AbstractProviderCopyright © 2018. All Rights Reserved.