public class OAuthTokenStoreImpl extends DefaultComponent implements OAuthTokenStore
OAuthTokenStore
.
This service is responsible for managing storage of the OAuthToken
. A simple SQL Directory is used for ACCESS
Token whereas a simple in memory storage is used for REQUEST Tokens.
Modifier and Type | Field and Description |
---|---|
static String |
DIRECTORY_NAME |
protected static org.apache.commons.logging.Log |
log |
protected Map<String,OAuthToken> |
requestTokenStore |
lastModified
Constructor and Description |
---|
OAuthTokenStoreImpl() |
Modifier and Type | Method and Description |
---|---|
OAuthToken |
addVerifierToRequestToken(String token,
Long duration)
Generates a verification code and attache it to the REQUEST Token.
|
OAuthToken |
createAccessTokenFromRequestToken(OAuthToken requestToken)
Exchanges the REQUEST Token witha Real ACCESS Token (persistent) Token/TocketSecret Strings are regerated during
the exchange.
|
OAuthToken |
createRequestToken(String consumerKey,
String callBack)
Creates a new REQUEST Token (transient)
|
OAuthToken |
getAccessToken(String token)
Retrieves an ACCESS from the store.
|
NuxeoOAuthToken |
getClientAccessToken(String appId,
String owner)
Get a Access token for the Shindig Client.
|
OAuthToken |
getRequestToken(String token)
Retrieves a REQUEST Token given a Token string (extracted from the Request).
|
protected NuxeoOAuthToken |
getTokenFromDirectory(String token) |
protected NuxeoOAuthToken |
getTokenFromDirectoryEntry(DocumentModel entry) |
List<OAuthToken> |
listAccessTokenForConsumer(String consumerKey)
Lists ACCESS Token associated to a Consumer application.
|
List<OAuthToken> |
listAccessTokenForUser(String login)
Lists ACCESS Token associated to a User.
|
void |
removeAccessToken(String token)
Deletes an ACCESS Token from the storage.
|
void |
removeClientAccessToken(String appId,
String owner)
Deletes a Client side Access Token.
|
void |
removeRequestToken(String token)
Deletes a REQUEST Token.
|
protected NuxeoOAuthToken |
storeAccessTokenAsDirectoryEntry(NuxeoOAuthToken aToken) |
void |
storeClientAccessToken(String consumerKey,
String callBack,
String token,
String tokenSecret,
String appId,
String owner)
Stores a Access token generated fro Shindig client.
|
activate, deactivate, getAdapter, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected static final org.apache.commons.logging.Log log
public static final String DIRECTORY_NAME
protected Map<String,OAuthToken> requestTokenStore
public OAuthTokenStoreImpl()
public OAuthToken addVerifierToRequestToken(String token, Long duration)
OAuthTokenStore
addVerifierToRequestToken
in interface OAuthTokenStore
public OAuthToken createAccessTokenFromRequestToken(OAuthToken requestToken)
OAuthTokenStore
createAccessTokenFromRequestToken
in interface OAuthTokenStore
public NuxeoOAuthToken getClientAccessToken(String appId, String owner)
OAuthTokenStore
getClientAccessToken
in interface OAuthTokenStore
public void removeClientAccessToken(String appId, String owner)
OAuthTokenStore
removeClientAccessToken
in interface OAuthTokenStore
public void storeClientAccessToken(String consumerKey, String callBack, String token, String tokenSecret, String appId, String owner)
OAuthTokenStore
storeClientAccessToken
in interface OAuthTokenStore
protected NuxeoOAuthToken getTokenFromDirectory(String token)
protected NuxeoOAuthToken getTokenFromDirectoryEntry(DocumentModel entry)
protected NuxeoOAuthToken storeAccessTokenAsDirectoryEntry(NuxeoOAuthToken aToken)
public OAuthToken createRequestToken(String consumerKey, String callBack)
OAuthTokenStore
createRequestToken
in interface OAuthTokenStore
public OAuthToken getAccessToken(String token)
OAuthTokenStore
getAccessToken
in interface OAuthTokenStore
public OAuthToken getRequestToken(String token)
OAuthTokenStore
getRequestToken
in interface OAuthTokenStore
public List<OAuthToken> listAccessTokenForConsumer(String consumerKey)
OAuthTokenStore
listAccessTokenForConsumer
in interface OAuthTokenStore
public List<OAuthToken> listAccessTokenForUser(String login)
OAuthTokenStore
listAccessTokenForUser
in interface OAuthTokenStore
public void removeAccessToken(String token)
OAuthTokenStore
removeAccessToken
in interface OAuthTokenStore
public void removeRequestToken(String token)
OAuthTokenStore
removeRequestToken
in interface OAuthTokenStore
Copyright © 2018 Nuxeo. All rights reserved.