Package play.libs
Class OAuth
- java.lang.Object
-
- play.libs.OAuth
-
public class OAuth extends java.lang.Object
Library to access resources protected by OAuth 1.0a. For OAuth 2.0, see play.libs.OAuth2.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OAuth.Error
static class
OAuth.Response
Response to an OAuth 1.0 request.static class
OAuth.ServiceInfo
Information relative to an OAuth 1.0 provider.static class
OAuth.TokenPair
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
isVerifierResponse()
java.lang.String
redirectUrl(java.lang.String token)
java.lang.String
redirectUrl(OAuth.TokenPair tokenPair)
Deprecated.OAuth.TokenPair
requestAccessToken(OAuth.TokenPair tokenPair)
Deprecated.use retrieveAccessToken() insteadOAuth.TokenPair
requestUnauthorizedToken()
Deprecated.use retrieveRequestToken() insteadOAuth.Response
retrieveAccessToken(java.lang.String token, java.lang.String secret)
Exchange a request token for an access token.OAuth.Response
retrieveAccessToken(OAuth.Response requestTokenResponse)
Exchange a request token for an access token.OAuth.Response
retrieveRequestToken()
Request the request token and secret.OAuth.Response
retrieveRequestToken(java.lang.String callbackURL)
Request the request token and secret.static OAuth
service(OAuth.ServiceInfo info)
Create an OAuth object for the service described in info
-
-
-
Method Detail
-
service
public static OAuth service(OAuth.ServiceInfo info)
Create an OAuth object for the service described in info- Parameters:
info
- must contain all information related to the service- Returns:
- the OAuth object
-
isVerifierResponse
public static boolean isVerifierResponse()
-
retrieveRequestToken
public OAuth.Response retrieveRequestToken()
Request the request token and secret.- Returns:
- a Response object holding either the result in case of a success or the error
-
retrieveRequestToken
public OAuth.Response retrieveRequestToken(java.lang.String callbackURL)
Request the request token and secret.- Parameters:
callbackURL
- the URL where the provider should redirect to- Returns:
- a Response object holding either the result in case of a success or the error
-
retrieveAccessToken
public OAuth.Response retrieveAccessToken(OAuth.Response requestTokenResponse)
Exchange a request token for an access token.- Parameters:
requestTokenResponse
- a successful response obtained from retrieveRequestToken- Returns:
- a Response object holding either the result in case of a success or the error
-
retrieveAccessToken
public OAuth.Response retrieveAccessToken(java.lang.String token, java.lang.String secret)
Exchange a request token for an access token.- Parameters:
token
- the token obtained from a previous callsecret
- your application secret- Returns:
- a Response object holding either the result in case of a success or the error
-
requestUnauthorizedToken
@Deprecated public OAuth.TokenPair requestUnauthorizedToken()
Deprecated.use retrieveRequestToken() insteadRequest the unauthorized token and secret. They can then be read with getTokens()- Returns:
- the url to redirect the user to get the verifier and continue the process
-
requestAccessToken
@Deprecated public OAuth.TokenPair requestAccessToken(OAuth.TokenPair tokenPair)
Deprecated.use retrieveAccessToken() instead- Parameters:
tokenPair
- The token / secret pair- Returns:
- the url
-
redirectUrl
public java.lang.String redirectUrl(java.lang.String token)
-
redirectUrl
@Deprecated public java.lang.String redirectUrl(OAuth.TokenPair tokenPair)
Deprecated.
-
-