public interface OAuthService
Modifier and Type | Method and Description |
---|---|
Token |
getAccessToken(Token requestToken,
Verifier verifier)
Retrieve the access token
|
java.lang.String |
getAuthorizationUrl(Token requestToken)
Returns the URL where you should redirect your users to authenticate your application.
|
Token |
getRequestToken()
Retrieve the request token.
|
java.lang.String |
getVersion()
Returns the OAuth version of the service.
|
Token |
refreshAccessToken(Token refreshOrAccessToken,
boolean includeSecret)
Refresh the access token to extend its expiration date.
|
void |
signRequest(Token accessToken,
OAuthRequest request)
Signs am OAuth request
|
Token getRequestToken()
Token getAccessToken(@Nullable Token requestToken, Verifier verifier)
requestToken
- request token (obtained previously; not required for OAuth 2)verifier
- verifier codeToken refreshAccessToken(Token refreshOrAccessToken, boolean includeSecret)
Token.getRawResponse()
returned by getAccessToken(jsimple.oauth.model.Token, jsimple.oauth.model.Verifier)
)
As for the client secret, for some providers in some scenarios it's not required. In particular, for Live
Connect (taken from http://msdn.microsoft.com/en-us/library/live/hh243647.aspx): "Because apps must also refresh
access tokens, the Live Connect app management site allows apps to be marked as mobile client apps. When this
marker is specified and the special redirect URL (https://login.live.com/oauth20_desktop.srf) is used, the client
secret is not required to refresh the access token.".refreshOrAccessToken
- access or refresh token, depending on the OAuth providerincludeSecret
- whether or not to include the client secret; Windows Live, for mobile apps, doesn't
require itvoid signRequest(Token accessToken, OAuthRequest request)
accessToken
- access token (obtained previously)request
- request to signjava.lang.String getVersion()
java.lang.String getAuthorizationUrl(@Nullable Token requestToken)
requestToken
- the request token you need to authorize; not used for OAuth2