public class Hybrid extends Object implements OAuthStrategyBase
| Constructor and Description |
|---|
Hybrid(OAuthConfig config,
Map<String,String> endpoints) |
| Modifier and Type | Method and Description |
|---|---|
Response |
executeFeed(String url)
Makes HTTP GET request to a given URL.It attaches access token in URL if
required.
|
Response |
executeFeed(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 if
required.
|
AccessGrant |
getAccessGrant()
Retrieves the AccessGrant object.
|
String |
getLoginRedirectURL(String successUrl)
It provides the URL which will be used for authentication with the
provider
|
String |
getLoginRedirectURL(String successUrl,
Map<String,String> requestParams)
It provides the URL which will be used for authentication with the
provider
|
void |
logout()
Logout
|
void |
setAccessGrant(AccessGrant accessGrant)
Stores access grant for the provider
|
void |
setAccessTokenParameterName(String accessTokenParameterName)
Sets the name of access token parameter which will returns by the
provider.
|
void |
setPermission(Permission permission)
Sets the permission
|
void |
setScope(String scope)
Sets the scope string
|
Response |
uploadImage(String url,
String methodType,
Map<String,String> params,
Map<String,String> headerParams,
String fileName,
InputStream inputStream,
String fileParamName)
Makes HTTP request to upload image and status.
|
AccessGrant |
verifyResponse(Map<String,String> requestParams)
Verifies the user and get access token
|
AccessGrant |
verifyResponse(Map<String,String> requestParams,
String methodType)
Verifies the user and get access token
|
public Hybrid(OAuthConfig config, Map<String,String> endpoints)
public String getLoginRedirectURL(String successUrl) throws Exception
OAuthStrategyBasegetLoginRedirectURL in interface OAuthStrategyBasesuccessUrl - the call back url on which user will be redirected after
authenticationExceptionpublic String getLoginRedirectURL(String successUrl, Map<String,String> requestParams) throws Exception
OAuthStrategyBasegetLoginRedirectURL in interface OAuthStrategyBasesuccessUrl - the call back url on which user will be redirected after
authenticationrequestParams - parameters need to pass in requestExceptionpublic AccessGrant verifyResponse(Map<String,String> requestParams) throws Exception
OAuthStrategyBaseverifyResponse in interface OAuthStrategyBaserequestParams - request parameters, received from the providerExceptionpublic AccessGrant verifyResponse(Map<String,String> requestParams, String methodType) throws Exception
OAuthStrategyBaseverifyResponse in interface OAuthStrategyBaseExceptionpublic Response executeFeed(String url) throws Exception
OAuthStrategyBaseexecuteFeed in interface OAuthStrategyBaseurl - URL to make HTTP request.Exceptionpublic Response executeFeed(String url, String methodType, Map<String,String> params, Map<String,String> headerParams, String body) throws Exception
OAuthStrategyBaseexecuteFeed in interface OAuthStrategyBaseurl - URL to make HTTP request.methodType - Method type can be GET, POST or PUTparams - Not using this parameter in Google API functionheaderParams - Parameters need to pass as Header Parametersbody - Request BodyExceptionpublic void setPermission(Permission permission)
OAuthStrategyBasesetPermission in interface OAuthStrategyBasepermission - Permission object which can be Permission.AUHTHENTICATE_ONLY,
Permission.ALL, Permission.DEFAULTpublic void setScope(String scope)
OAuthStrategyBasesetScope in interface OAuthStrategyBasescope - scope stringpublic void setAccessGrant(AccessGrant accessGrant)
OAuthStrategyBasesetAccessGrant in interface OAuthStrategyBaseaccessGrant - It contains the access token and other informationpublic void setAccessTokenParameterName(String accessTokenParameterName)
OAuthStrategyBasesetAccessTokenParameterName in interface OAuthStrategyBasepublic void logout()
OAuthStrategyBaselogout in interface OAuthStrategyBasepublic Response uploadImage(String url, String methodType, Map<String,String> params, Map<String,String> headerParams, String fileName, InputStream inputStream, String fileParamName) throws Exception
OAuthStrategyBaseuploadImage in interface OAuthStrategyBaseurl - URL to make HTTP request.methodType - Method type can be GET, POST or PUTparams - Parameters need to pass in requestheaderParams - Parameters need to pass as Header ParametersfileName - Image file nameinputStream - Input stream of imagefileParamName - Image Filename parameter. It requires in some provider.Exceptionpublic AccessGrant getAccessGrant()
OAuthStrategyBasegetAccessGrant in interface OAuthStrategyBaseCopyright © 2018. All Rights Reserved.