org.brickred.socialauth.oauthstrategy
Interface OAuthStrategyBase

All Superinterfaces:
Serializable
All Known Implementing Classes:
Hybrid, OAuth1, OAuth2

public interface OAuthStrategyBase
extends Serializable


Method Summary
 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
 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
 

Method Detail

getLoginRedirectURL

String getLoginRedirectURL(String successUrl)
                           throws Exception
It provides the URL which will be used for authentication with the provider

Parameters:
successUrl - the call back url on which user will be redirected after authentication
Returns:
the authentication url
Throws:
Exception

verifyResponse

AccessGrant verifyResponse(Map<String,String> requestParams)
                           throws Exception
Verifies the user and get access token

Parameters:
requestParams - request parameters, received from the provider
Returns:
AccessGrant which contains access token and other information
Throws:
Exception

verifyResponse

AccessGrant verifyResponse(Map<String,String> requestParams,
                           String methodType)
                           throws Exception
Verifies the user and get access token

Parameters:
requestParams -
methodType -
Returns:
AccessGrant which contains access token and other attributes
Throws:
Exception

executeFeed

Response executeFeed(String url)
                     throws Exception
Makes HTTP GET request to a given URL.It attaches access token in URL if required.

Parameters:
url - URL to make HTTP request.
Returns:
Response object
Throws:
Exception

executeFeed

Response executeFeed(String url,
                     String methodType,
                     Map<String,String> params,
                     Map<String,String> headerParams,
                     String body)
                     throws Exception
Makes HTTP request to a given URL.It attaches access token in URL if required.

Parameters:
url - URL to make HTTP request.
methodType - Method type can be GET, POST or PUT
params - Not using this parameter in Google API function
headerParams - Parameters need to pass as Header Parameters
body - Request Body
Throws:
Exception

setPermission

void setPermission(Permission permission)
Sets the permission

Parameters:
permission - Permission object which can be Permission.AUHTHENTICATE_ONLY, Permission.ALL, Permission.DEFAULT

setScope

void setScope(String scope)
Sets the scope string

Parameters:
scope - scope string

setAccessGrant

void setAccessGrant(AccessGrant accessGrant)
Stores access grant for the provider

Parameters:
accessGrant - It contains the access token and other information
Throws:
Exception

setAccessTokenParameterName

void setAccessTokenParameterName(String accessTokenParameterName)
Sets the name of access token parameter which will returns by the provider. By default it is "access_token"

Parameters:
accessTokenParameterName -

logout

void logout()
Logout


uploadImage

Response uploadImage(String url,
                     String methodType,
                     Map<String,String> params,
                     Map<String,String> headerParams,
                     String fileName,
                     InputStream inputStream,
                     String fileParamName)
                     throws Exception
Makes HTTP request to upload image and status.

Parameters:
url - URL to make HTTP request.
methodType - Method type can be GET, POST or PUT
params - Parameters need to pass in request
headerParams - Parameters need to pass as Header Parameters
fileName - Image file name
inputStream - Input stream of image
fileParamName - Image Filename parameter. It requires in some provider.
Returns:
Response object
Throws:
Exception

getAccessGrant

AccessGrant getAccessGrant()
Retrieves the AccessGrant object.

Returns:
AccessGrant object.


Copyright © 2013. All Rights Reserved.