play.libs
Class OAuth

java.lang.Object
  extended by play.libs.OAuth

public class OAuth
extends java.lang.Object


Nested Class Summary
static class OAuth.ConsumerKey
          A consumer key / consumer secret pair that the OAuth provider gave you, to identify your application.
static class OAuth.OAuthCalculator
          A signature calculator for the Play WS API.
static class OAuth.RequestToken
          A request token / token secret pair, to be used for a specific user.
static class OAuth.ServiceInfo
          The information identifying a oauth provider: URLs and the consumer key / consumer secret pair.
static class OAuth.WSRequestAdapter
           
 
Constructor Summary
OAuth(OAuth.ServiceInfo info)
           
OAuth(OAuth.ServiceInfo info, boolean use10a)
           
 
Method Summary
 OAuth.ServiceInfo getInfo()
           
 oauth.signpost.OAuthProvider getProvider()
           
 java.lang.String redirectUrl(java.lang.String token)
          The URL where the user needs to be redirected to grant authorization to your application.
 OAuth.RequestToken retrieveAccessToken(OAuth.RequestToken token, java.lang.String verifier)
          Exchange a request token for an access token.
 OAuth.RequestToken retrieveRequestToken(java.lang.String callbackURL)
          Request the request token and secret.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OAuth

public OAuth(OAuth.ServiceInfo info)

OAuth

public OAuth(OAuth.ServiceInfo info,
             boolean use10a)
Method Detail

getInfo

public OAuth.ServiceInfo getInfo()

getProvider

public oauth.signpost.OAuthProvider getProvider()

retrieveRequestToken

public OAuth.RequestToken retrieveRequestToken(java.lang.String callbackURL)
Request the request token and secret.

Parameters:
callbackURL - the URL where the provider should redirect to (usually a URL on the current app)
Returns:
A Right(RequestToken) in case of success, Left(OAuthException) otherwise

retrieveAccessToken

public OAuth.RequestToken retrieveAccessToken(OAuth.RequestToken token,
                                              java.lang.String verifier)
Exchange a request token for an access token.

Parameters:
token - the token/secret pair obtained from a previous call
verifier - a string you got through your user, with redirection
Returns:
A Right(RequestToken) in case of success, Left(OAuthException) otherwise

redirectUrl

public java.lang.String redirectUrl(java.lang.String token)
The URL where the user needs to be redirected to grant authorization to your application.

Parameters:
token - request token