|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.resteasy.auth.oauth.OAuthProviderChecker
public class OAuthProviderChecker
Used to make sure the OAuthProvider implementer does not return null values. If any null is returned, throws a RuntimeException
Constructor Summary | |
---|---|
OAuthProviderChecker(OAuthProvider provider)
|
Method Summary | |
---|---|
java.lang.String |
authoriseRequestToken(java.lang.String consumerKey,
java.lang.String requestKey)
Authorises the given Request Token for the given Consumer and return a new Verifier to be returned to the Client. |
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 accessKey)
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 consumerKey,
java.lang.String requestKey)
Returns the OAuth Request Token for the given Consumer key and Request Token. |
OAuthToken |
makeAccessToken(java.lang.String consumerKey,
java.lang.String requestKey,
java.lang.String verifier)
Make a new OAuth Access Token for the given Consumer, using the given Request Token and Verifier. |
OAuthToken |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OAuthProviderChecker(OAuthProvider provider)
Method Detail |
---|
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 java.lang.String getRealm()
OAuthProvider
getRealm
in interface OAuthProvider
public OAuthRequestToken getRequestToken(java.lang.String consumerKey, java.lang.String requestKey) throws OAuthException
OAuthProvider
getRequestToken
in interface OAuthProvider
consumerKey
- the Consumer key whose Request Token we want to loadrequestKey
- 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 accessKey) 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 requestKey, java.lang.String verifier) throws OAuthException
OAuthProvider
makeAccessToken
in interface OAuthProvider
consumerKey
- the Consumer key for whom to create a new Access TokenrequestKey
- 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 OAuthToken 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 java.lang.String authoriseRequestToken(java.lang.String consumerKey, java.lang.String requestKey) throws OAuthException
OAuthProvider
authoriseRequestToken
in interface OAuthProvider
consumerKey
- the Consumer Key whose Request Token we want to authoriserequestKey
- 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 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 |