public class SampleOAuthDataStore extends Object implements OAuthDataStore
| Constructor and Description |
|---|
SampleOAuthDataStore(JsonDbOpensocialService dbService,
String baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
void |
authorizeToken(OAuthEntry entry,
String userId)
Authorize the request token for the given user id.
|
OAuthEntry |
convertToAccessToken(OAuthEntry entry)
Called when converting a request token to an access token.
|
void |
disableToken(OAuthEntry entry)
Mark a token DISABLED and store it.
|
OAuthEntry |
generateRequestToken(String consumerKey,
String oauthVersion,
String signedCallbackUrl,
String virtualOrganization)
Generate a valid requestToken for the given consumerKey.
|
net.oauth.OAuthConsumer |
getConsumer(String consumerKey)
Lookup consumers.
|
OAuthEntry |
getEntry(String oauthToken)
Get the OAuthEntry that corresponds to the oauthToken.
|
SecurityToken |
getSecurityTokenForConsumerRequest(String consumerKey,
String userId,
net.oauth.OAuthConsumer authConsumer)
Return the proper security token for a 2 legged oauth request that has been validated
for the given consumerKey.
|
void |
removeToken(OAuthEntry entry)
Remove a token
|
@Inject public SampleOAuthDataStore(JsonDbOpensocialService dbService, String baseUrl)
public OAuthEntry getEntry(String oauthToken)
OAuthDataStoregetEntry in interface OAuthDataStoreoauthToken - a non-null oauthTokenpublic net.oauth.OAuthConsumer getConsumer(String consumerKey)
OAuthDataStoregetConsumer in interface OAuthDataStoreconsumerKey - A valid, non-null ConsumerKeypublic OAuthEntry generateRequestToken(String consumerKey, String oauthVersion, String signedCallbackUrl, String virtualOrganization)
OAuthDataStoregenerateRequestToken in interface OAuthDataStoreconsumerKey - A valid consumer keyoauthVersion - The version (1 or 1a)signedCallbackUrl - Callback URL sent from consumer, may be null. If callbackUrl is not
null then the returned entry should have signedCallbackUrl set to true.virtualOrganization - the virtualOrganization context (if any)public OAuthEntry convertToAccessToken(OAuthEntry entry)
OAuthDataStoreconvertToAccessToken in interface OAuthDataStoreentry - The Entry to convertpublic void authorizeToken(OAuthEntry entry, String userId)
OAuthDataStoreauthorizeToken in interface OAuthDataStoreentry - A valid OAuthEntryuserId - A user idpublic void disableToken(OAuthEntry entry)
OAuthDataStoredisableToken in interface OAuthDataStoreentry - A valid OAuthEntrypublic void removeToken(OAuthEntry entry)
OAuthDataStoreremoveToken in interface OAuthDataStoreentry - A valid OAuthEntrypublic SecurityToken getSecurityTokenForConsumerRequest(String consumerKey, String userId, net.oauth.OAuthConsumer authConsumer)
OAuthDataStoregetSecurityTokenForConsumerRequest in interface OAuthDataStoreconsumerKey - A consumer keyuserId - The userId to validate.authConsumer - The OAuthConsumerCopyright © 2007-2012. All Rights Reserved.