oauthP5.oauth
Class OAuth20ServiceImpl

java.lang.Object
  extended by oauthP5.oauth.OAuth20ServiceImpl
All Implemented Interfaces:
OAuthService

public class OAuth20ServiceImpl
extends Object
implements OAuthService


Constructor Summary
OAuth20ServiceImpl(DefaultApi20 api, OAuthConfig config)
          Default constructor
 
Method Summary
 Token getAccessToken(Token requestToken, Verifier verifier)
          Retrieve the access token
 String getAuthorizationUrl(Token requestToken)
          Returns the URL where you should redirect your users to authenticate your application.
 Token getRequestToken()
          Retrieve the request token.
 String getVersion()
          Returns the OAuth version of the service.
 void signRequest(Token accessToken, OAuthRequest request)
          Signs am OAuth request
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth20ServiceImpl

public OAuth20ServiceImpl(DefaultApi20 api,
                          OAuthConfig config)
Default constructor

Parameters:
api - OAuth2.0 api information
config - OAuth 2.0 configuration param object
Method Detail

getAccessToken

public Token getAccessToken(Token requestToken,
                            Verifier verifier)
Retrieve the access token

Specified by:
getAccessToken in interface OAuthService
Parameters:
requestToken - request token (obtained previously)
verifier - verifier code
Returns:
access token

getRequestToken

public Token getRequestToken()
Retrieve the request token.

Specified by:
getRequestToken in interface OAuthService
Returns:
request token

getVersion

public String getVersion()
Returns the OAuth version of the service.

Specified by:
getVersion in interface OAuthService
Returns:
oauth version as string

signRequest

public void signRequest(Token accessToken,
                        OAuthRequest request)
Signs am OAuth request

Specified by:
signRequest in interface OAuthService
Parameters:
accessToken - access token (obtained previously)
request - request to sign

getAuthorizationUrl

public String getAuthorizationUrl(Token requestToken)
Returns the URL where you should redirect your users to authenticate your application.

Specified by:
getAuthorizationUrl in interface OAuthService
Parameters:
requestToken - the request token you need to authorize
Returns:
the URL where you should redirect your users


Processing library oauthP5 by New York Times R&D Lab. (c) 2012