|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.resteasy.auth.oauth.OAuthMemoryProvider
public class OAuthMemoryProvider
OAuthProvider that keeps all data in memory. Mainly used as an example and for tests.
Constructor Summary | |
---|---|
OAuthMemoryProvider()
|
|
OAuthMemoryProvider(java.lang.String realm)
|
Method Summary | |
---|---|
protected OAuthConsumer |
_getConsumer(java.lang.String consumerKey)
|
protected void |
addAccessKey(java.lang.String consumerKey,
java.lang.String accessToken,
java.lang.String accessSecret,
java.lang.String[] permissions)
|
protected void |
addConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
|
protected void |
addRequestKey(java.lang.String consumerKey,
java.lang.String requestToken,
java.lang.String requestSecret,
java.lang.String callback,
java.lang.String[] scopes)
|
java.lang.String |
authoriseRequestToken(java.lang.String consumerKey,
java.lang.String requestToken)
Authorises the given Request Token for the given Consumer and return a new Verifier to be returned to the Client. |
protected void |
authoriseRequestToken(java.lang.String consumerKey,
java.lang.String requestToken,
java.lang.String verifier)
|
void |
checkTimestamp(OAuthToken token,
long timestamp)
Checks that the given timestamp is valid for the given OAuth Token. |
OAuthToken |
getAccessToken(java.lang.String consumerKey,
java.lang.String accessToken)
Returns the OAuth Access Token for the given Consumer key and Access Token. |
OAuthConsumer |
getConsumer(java.lang.String consumerKey)
Returns the OAuth Consumer for the given Consumer key. |
java.lang.String |
getRealm()
Returns the Realm of this provider |
OAuthRequestToken |
getRequestToken(java.lang.String requestToken)
|
OAuthRequestToken |
getRequestToken(java.lang.String consumerKey,
java.lang.String requestToken)
Returns the OAuth Request Token for the given Consumer key and Request Token. |
OAuthToken |
makeAccessToken(java.lang.String consumerKey,
java.lang.String requestToken,
java.lang.String verifier)
Make a new OAuth Access Token for the given Consumer, using the given Request Token and Verifier. |
OAuthRequestToken |
makeRequestToken(java.lang.String consumerKey,
java.lang.String callback,
java.lang.String[] scopes,
java.lang.String[] permissions)
Make a new OAuth Request Token for the given Consumer, using the given callback. |
OAuthConsumer |
registerConsumer(java.lang.String consumerKey,
java.lang.String displayName,
java.lang.String connectURI)
Creates a new OAuth Consumer |
void |
registerConsumerPermissions(java.lang.String consumerKey,
OAuthPermissions permissions)
Registers Consumer Permissions |
void |
registerConsumerScopes(java.lang.String consumerKey,
java.lang.String[] scopes)
Registers Consumer Scopes |
OAuthRequestToken |
verifyAndRemoveRequestToken(java.lang.String customerKey,
java.lang.String requestToken,
java.lang.String verifier)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OAuthMemoryProvider()
public OAuthMemoryProvider(java.lang.String realm)
Method Detail |
---|
public OAuthRequestToken verifyAndRemoveRequestToken(java.lang.String customerKey, java.lang.String requestToken, java.lang.String verifier) throws OAuthException
OAuthException
protected void addConsumer(java.lang.String consumerKey, java.lang.String consumerSecret)
protected void addRequestKey(java.lang.String consumerKey, java.lang.String requestToken, java.lang.String requestSecret, java.lang.String callback, java.lang.String[] scopes) throws OAuthException
OAuthException
protected void addAccessKey(java.lang.String consumerKey, java.lang.String accessToken, java.lang.String accessSecret, java.lang.String[] permissions) throws OAuthException
OAuthException
protected void authoriseRequestToken(java.lang.String consumerKey, java.lang.String requestToken, java.lang.String verifier) throws OAuthException
OAuthException
protected OAuthConsumer _getConsumer(java.lang.String consumerKey) throws OAuthException
OAuthException
public java.lang.String getRealm()
OAuthProvider
getRealm
in interface OAuthProvider
public java.lang.String authoriseRequestToken(java.lang.String consumerKey, java.lang.String requestToken) throws OAuthException
OAuthProvider
authoriseRequestToken
in interface OAuthProvider
consumerKey
- the Consumer Key whose Request Token we want to authoriserequestToken
- the Request Token to authorise
OAuthException
- thrown if the given Consumer or Request Token do not exist, or if the Request Token has already been authorised.public OAuthConsumer registerConsumer(java.lang.String consumerKey, java.lang.String displayName, java.lang.String connectURI) throws OAuthException
OAuthConsumerRegistration
registerConsumer
in interface OAuthConsumerRegistration
consumerKey
- the Consumer key.
OAuthException
- thrown if Consumer can not be registered.public OAuthConsumer getConsumer(java.lang.String consumerKey) throws OAuthException
OAuthProvider
getConsumer
in interface OAuthProvider
consumerKey
- the Consumer key to load.
OAuthException
- thrown if the given Consumer does not exist.public OAuthRequestToken getRequestToken(java.lang.String consumerKey, java.lang.String requestToken) throws OAuthException
OAuthProvider
getRequestToken
in interface OAuthProvider
consumerKey
- the Consumer key whose Request Token we want to loadrequestToken
- the Request Token to load
OAuthException
- thrown if the given Request Token does not exist.public OAuthToken getAccessToken(java.lang.String consumerKey, java.lang.String accessToken) throws OAuthException
OAuthProvider
getAccessToken
in interface OAuthProvider
consumerKey
- the Consumer key whose Access Token we want to load
OAuthException
- thrown if the given Consumer or Access Token do not exist.public void checkTimestamp(OAuthToken token, long timestamp) throws OAuthException
OAuthProvider
checkTimestamp
in interface OAuthProvider
token
- the OAuth Token whose timestamp to check and save if validtimestamp
- the timestamp to check and save if valid
OAuthException
- thrown if the given timestamp is not greater or equal to the last timestamp associated
with the given OAuth Tokenpublic OAuthToken makeAccessToken(java.lang.String consumerKey, java.lang.String requestToken, java.lang.String verifier) throws OAuthException
OAuthProvider
makeAccessToken
in interface OAuthProvider
consumerKey
- the Consumer key for whom to create a new Access TokenrequestToken
- the Request Token to exchange for a new Access Tokenverifier
- the Client-specified Verifier that must match the Verifier that was given to the Client
when the given Request Token was authorised.
OAuthException
- thrown if the given Consumer or Request Token does not exist, if the Request Token is not authorised
or if the Verifier is invalid.public OAuthRequestToken makeRequestToken(java.lang.String consumerKey, java.lang.String callback, java.lang.String[] scopes, java.lang.String[] permissions) throws OAuthException
OAuthProvider
makeRequestToken
in interface OAuthProvider
consumerKey
- the Consumer key for whom to create a new Request Tokencallback
- the Client-specified callback for this Request Tokenscopes
- resource URIs the consumer would like to access
OAuthException
- thrown if the given Consumer does not existpublic OAuthRequestToken getRequestToken(java.lang.String requestToken) throws OAuthException
OAuthException
public void registerConsumerScopes(java.lang.String consumerKey, java.lang.String[] scopes) throws OAuthException
OAuthConsumerRegistration
registerConsumerScopes
in interface OAuthConsumerRegistration
consumerKey
- the Consumer key.
OAuthException
- thrown if scopes can not be registered.public void registerConsumerPermissions(java.lang.String consumerKey, OAuthPermissions permissions) throws OAuthException
OAuthConsumerRegistration
registerConsumerPermissions
in interface OAuthConsumerRegistration
consumerKey
- the Consumer key.
OAuthException
- thrown if permissions can not be registered.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |