com.dyuproject.oauth.sp
Interface ServiceToken.Store

All Known Implementing Classes:
ConcurrentMapHashStore, HashStore, PropertiesHashStore
Enclosing interface:
ServiceToken

public static interface ServiceToken.Store

The token store. Internally the implementation would generate new request tokens after validation and verification of the oauth parameters.


Method Summary
 ServiceToken getAccessToken(String consumerKey, String accessToken)
          Gets the access token to be verified by the caller; Returns null if the access token is invalid.
 String getAuthCallbackOrVerifier(String requestToken, String id)
          Gets the auth callback or verifier; This could either be the url with oauth_token and oauth_verifier params, or the verifier "oob".
 ServiceToken getRequestToken(String consumerKey, String requestToken)
          Gets the request token with secret to be verified by the caller; Returns null if the request token is invalid.
 ServiceToken newAccessToken(String consumerKey, String verifier, String requestToken)
          Generates a new access token that is basically exchanged from the given requestToken; Returns null if the requestToken is invalid.
 ServiceToken newAccessToken(String consumerKey, String verifier, String requestToken, ServiceToken verifiedRequestToken)
          Generates a new access token that is basically exchanged from the given requestToken; Returns null if the requestToken is invalid.
 ServiceToken newHybridRequestToken(String consumerKey, String id)
          Particularly useful for hybrid openid+oauth; The underlying implementation will loosen the validation/verification since openid authentication is being used.
 ServiceToken newRequestToken(String consumerKey, String callback)
          Generates a new request token to be used by the caller to write a response.
 

Method Detail

newRequestToken

ServiceToken newRequestToken(String consumerKey,
                             String callback)
Generates a new request token to be used by the caller to write a response. The token should generally be bound or associated with the consumerKey and callback.


getRequestToken

ServiceToken getRequestToken(String consumerKey,
                             String requestToken)
Gets the request token with secret to be verified by the caller; Returns null if the request token is invalid.


newHybridRequestToken

ServiceToken newHybridRequestToken(String consumerKey,
                                   String id)
Particularly useful for hybrid openid+oauth; The underlying implementation will loosen the validation/verification since openid authentication is being used.


getAuthCallbackOrVerifier

String getAuthCallbackOrVerifier(String requestToken,
                                 String id)
Gets the auth callback or verifier; This could either be the url with oauth_token and oauth_verifier params, or the verifier "oob".


newAccessToken

ServiceToken newAccessToken(String consumerKey,
                            String verifier,
                            String requestToken)
Generates a new access token that is basically exchanged from the given requestToken; Returns null if the requestToken is invalid.


newAccessToken

ServiceToken newAccessToken(String consumerKey,
                            String verifier,
                            String requestToken,
                            ServiceToken verifiedRequestToken)
Generates a new access token that is basically exchanged from the given requestToken; Returns null if the requestToken is invalid. The param verifiedRequestToken is the service token recently obtained from getRequestToken(String, String). That is to use the consumerSecret linked to the same consumerKey to avoid another lookup. This method is added for efficiency..


getAccessToken

ServiceToken getAccessToken(String consumerKey,
                            String accessToken)
Gets the access token to be verified by the caller; Returns null if the access token is invalid. This is the method that you will use for every subsequent oauth request from consumers who have already been authenticated. Even if the access token is valid, it could still return null due to an access token timeout.



Copyright © 2008-2013. All Rights Reserved.