org.jboss.seam.social.oauth
Interface OAuthProvider

All Known Implementing Classes:
OAuthProviderScribe

public interface OAuthProvider

Author:
Antoine Sabot-Durand Implementation of this Interface will provide low level service for OAuth management.

Method Summary
 OAuthToken getAccessToken(OAuthToken requestToken, String verifier)
          This method retrieves the Oauth access token from request token and verifier
 String getAuthorizationUrl(OAuthToken requestToken)
          Generates the OAuth authorization URL from the given request Token.
 OAuthToken getRequestToken()
          This method retrieves an OAuth request token to initiate an OAuth connection.
 String getVersion()
          Gives the OAuth version of the provider
 void initProvider(OAuthServiceSettings settings)
          Initializes the provider with the given settings containing OAuth api key andapi secret
 OAuthRequest requestFactory(RestVerb verb, String uri)
          Creates an OAuthRequest with the given Rest Verb and uri
 void signRequest(OAuthToken accessToken, OAuthRequest request)
          Sign an OAuthRequest in order to make it valid for targeted service
 OAuthToken tokenFactory(String token, String secret)
          Creates an OAuthToken with the given token and given secret
 

Method Detail

getRequestToken

OAuthToken getRequestToken()
This method retrieves an OAuth request token to initiate an OAuth connection. It's the the first step of OAuth negotiation connection

Returns:
an OAuth request token

getAccessToken

OAuthToken getAccessToken(OAuthToken requestToken,
                          String verifier)
This method retrieves the Oauth access token from request token and verifier

Parameters:
requestToken -
verifier -
Returns:
an OAuth access token

signRequest

void signRequest(OAuthToken accessToken,
                 OAuthRequest request)
Sign an OAuthRequest in order to make it valid for targeted service

Parameters:
accessToken - the OAuth access token for the current OAuth session
request - the OAuth request to sign

getVersion

String getVersion()
Gives the OAuth version of the provider

Returns:
the OAuth version used by the provider

getAuthorizationUrl

String getAuthorizationUrl(OAuthToken requestToken)
Generates the OAuth authorization URL from the given request Token. It's the step 2 of OAuth negotiation

Parameters:
tok -
Returns:

initProvider

void initProvider(OAuthServiceSettings settings)
Initializes the provider with the given settings containing OAuth api key andapi secret

Parameters:
settings -

requestFactory

OAuthRequest requestFactory(RestVerb verb,
                            String uri)
Creates an OAuthRequest with the given Rest Verb and uri

Parameters:
verb -
uri -
Returns:
the created OAuthRequest

tokenFactory

OAuthToken tokenFactory(String token,
                        String secret)
Creates an OAuthToken with the given token and given secret

Parameters:
token -
secret -
Returns:
then created OAuthToken


Copyright © 2011 Seam Framework. All Rights Reserved.