org.apache.shindig.gadgets.oauth
Class GadgetOAuthTokenStore

java.lang.Object
  extended by org.apache.shindig.gadgets.oauth.GadgetOAuthTokenStore

public class GadgetOAuthTokenStore
extends Object

Higher-level interface that allows callers to store and retrieve OAuth-related data directly from GadgetSpecs, GadgetContexts, etc. See OAuthStore for a more detailed explanation of the OAuth Data Store.


Constructor Summary
GadgetOAuthTokenStore(OAuthStore store, GadgetSpecFactory specFactory)
          Public constructor.
 
Method Summary
 AccessorInfo getOAuthAccessor(SecurityToken securityToken, OAuthArguments arguments, OAuthClientState clientState, OAuthResponseParams responseParams, OAuthFetcherConfig fetcherConfig)
          Retrieve an AccessorInfo and OAuthAccessor that are ready for signing OAuthMessages.
 void removeToken(SecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo, OAuthArguments arguments, OAuthResponseParams responseParams)
          Remove an access token for the given user/gadget/service/token name
 void storeTokenKeyAndSecret(SecurityToken securityToken, OAuthStore.ConsumerInfo consumerInfo, OAuthArguments arguments, OAuthStore.TokenInfo tokenInfo, OAuthResponseParams responseParams)
          Store an access token for the given user/gadget/service/token name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GadgetOAuthTokenStore

@Inject
public GadgetOAuthTokenStore(OAuthStore store,
                                    GadgetSpecFactory specFactory)
Public constructor.

Parameters:
store - an OAuthStore that can store and retrieve OAuth tokens, as well as information about service providers.
Method Detail

getOAuthAccessor

public AccessorInfo getOAuthAccessor(SecurityToken securityToken,
                                     OAuthArguments arguments,
                                     OAuthClientState clientState,
                                     OAuthResponseParams responseParams,
                                     OAuthFetcherConfig fetcherConfig)
                              throws OAuthRequestException
Retrieve an AccessorInfo and OAuthAccessor that are ready for signing OAuthMessages. To do this, we need to figure out: - what consumer key/secret to use for signing. - if an access token should be used for the request, and if so what it is. * - the OAuth request/authorization/access URLs. - what HTTP method to use for request token and access token requests - where the OAuth parameters are located. - Information from the OAuth Fetcher config to determine if owner pages are secure Note that most of that work gets skipped for signed fetch, we just look up the consumer key and secret for that. Signed fetch always sticks the parameters in the query string.

Throws:
OAuthRequestException

storeTokenKeyAndSecret

public void storeTokenKeyAndSecret(SecurityToken securityToken,
                                   OAuthStore.ConsumerInfo consumerInfo,
                                   OAuthArguments arguments,
                                   OAuthStore.TokenInfo tokenInfo,
                                   OAuthResponseParams responseParams)
                            throws OAuthRequestException
Store an access token for the given user/gadget/service/token name

Throws:
OAuthRequestException

removeToken

public void removeToken(SecurityToken securityToken,
                        OAuthStore.ConsumerInfo consumerInfo,
                        OAuthArguments arguments,
                        OAuthResponseParams responseParams)
                 throws OAuthRequestException
Remove an access token for the given user/gadget/service/token name

Throws:
OAuthRequestException


Copyright © 2007-2012. All Rights Reserved.