org.codegist.crest.oauth
Interface OAuthenticator

All Known Implementing Classes:
OAuthenticatorV10

public interface OAuthenticator

OAuth authentificator interface

Author:
Laurent Gilles (laurent.gilles@codegist.org)

Method Summary
 Token getAccessToken(Token requestToken, String verifier)
          Exchanges the given request token with a new access token using the given verifier
 Token getRequestToken()
          Fires a get request token to the preconfigured url
 Token refreshAccessToken(Token accessToken, String... includeExtras)
          Refreshs the given access token if it has expired.
 void sign(Token accessToken, HttpRequest.Builder request, Pair<String,String>... extraAuthHeaders)
          Signs the given request using the given access token and the optional additional oauth headers.
 

Method Detail

sign

void sign(Token accessToken,
          HttpRequest.Builder request,
          Pair<String,String>... extraAuthHeaders)
Signs the given request using the given access token and the optional additional oauth headers.

Parameters:
accessToken - Access token to be used
request - request to be signed
extraAuthHeaders - optional header to be added in the oauth authentification headers

getRequestToken

Token getRequestToken()
Fires a get request token to the preconfigured url

Returns:
A new request token

getAccessToken

Token getAccessToken(Token requestToken,
                     String verifier)
Exchanges the given request token with a new access token using the given verifier

Parameters:
requestToken - request token to exchange
verifier - verifier
Returns:
new access token

refreshAccessToken

Token refreshAccessToken(Token accessToken,
                         String... includeExtras)
Refreshs the given access token if it has expired. Include optional extra oauth header from the extra field of the token.

Parameters:
accessToken - expired access token
includeExtras - extras field name from the given token to include in the request
Returns:
a new access token
See Also:
Token.getExtras()


Copyright © 2011. All Rights Reserved.