org.mule.security.oauth
Interface OAuth1Adapter

All Superinterfaces:
OAuth1Connector, OAuthAdapter, OnNoTokenPolicyAware, Serializable

public interface OAuth1Adapter
extends OAuthAdapter, OAuth1Connector


Method Summary
 String authorize(Map<String,String> extraParameters, String requestTokenUrl, String accessTokenUrl, String authorizationUrl, String redirectUri)
          Builds the authorization url to initiate the OAuth dance
 void fetchAccessToken(String requestTokenUrl, String accessTokenUrl, String authorizationUrl, String redirectUri)
          Fetches an access token and stores it into this adapter
 String getAccessTokenSecret()
          Retrieves the accessTokenSecret
 oauth.signpost.OAuthConsumer getConsumer()
          Returns an OAuthConsumer for this adapter
 OAuth1Manager getOauth1Manager()
          Gets an instance of OAuth1Manager serving this adapter
 RestoreAccessTokenCallback getOauthRestoreAccessToken()
          Get the callback to be called when the access token and secret need to be restored
 SaveAccessTokenCallback getOauthSaveAccessToken()
          Get the callback to be called when the access token and secret need to be saved for later restoration
 String getRequestToken()
          Returns the request token
 String getRequestTokenSecret()
          Gets the request token secret
 String getRequestTokenUrl()
          Retrieves requestTokenUrl
 void reset()
          Sets the adapter to a blank unauthorized state
 void setAccessTokenSecret(String value)
          Sets access token secret
 void setConsumer(oauth.signpost.OAuthConsumer consumer)
          Sets the OAuthConsumer
 void setOauthRestoreAccessToken(RestoreAccessTokenCallback restoreCallback)
          Set the callback to be called when the access token and secret need to be restored
 void setOauthSaveAccessToken(SaveAccessTokenCallback saveCallback)
          Set the callback to be called when the access token and secret need to be saved for later restoration
 void setRequestToken(String requestToken)
          Sets the request token
 void setRequestTokenSecret(String requestTokenSecret)
          Sets the request token secret
 void setRequestTokenUrl(String value)
          Sets requestTokenUrl
 
Methods inherited from interface org.mule.security.oauth.OAuthAdapter
getOauthVerifier, hasBeenAuthorized, setAccessToken, setAccessTokenUrl, setAuthorizationUrl, setOauthVerifier
 
Methods inherited from interface org.mule.security.oauth.OnNoTokenPolicyAware
getOnNoTokenPolicy, setOnNoTokenPolicy
 
Methods inherited from interface org.mule.security.oauth.OAuth1Connector
getAccessToken, getAccessTokenUrl, getAuthorizationUrl, getConsumerKey, getConsumerSecret, getMessageSigner, getScope, getSigningStrategy, getVerifierRegex
 

Method Detail

setRequestTokenUrl

void setRequestTokenUrl(String value)
Sets requestTokenUrl

Parameters:
value - a request token url

getRequestTokenUrl

String getRequestTokenUrl()
Retrieves requestTokenUrl


authorize

String authorize(Map<String,String> extraParameters,
                 String requestTokenUrl,
                 String accessTokenUrl,
                 String authorizationUrl,
                 String redirectUri)
                 throws org.mule.common.security.oauth.exception.UnableToAcquireRequestTokenException
Builds the authorization url to initiate the OAuth dance

Parameters:
extraParameters - provider specific extra parameters
requestTokenUrl - the url of the request token server
accessTokenUrl - the url of the access token server
authorizationUrl - the url of the authorization server
redirectUri - the redirection uri
Returns:
a String with the authorization url
Throws:
org.mule.common.security.oauth.exception.UnableToAcquireRequestTokenException

fetchAccessToken

void fetchAccessToken(String requestTokenUrl,
                      String accessTokenUrl,
                      String authorizationUrl,
                      String redirectUri)
                      throws org.mule.common.security.oauth.exception.UnableToAcquireAccessTokenException
Fetches an access token and stores it into this adapter

Parameters:
requestTokenUrl - the url of the request token server
accessTokenUrl - the url of the access token server
authorizationUrl - the url of the authorization server
redirectUri - the redirection uri
Throws:
org.mule.common.security.oauth.exception.UnableToAcquireAccessTokenException

setOauthSaveAccessToken

void setOauthSaveAccessToken(SaveAccessTokenCallback saveCallback)
Set the callback to be called when the access token and secret need to be saved for later restoration

Parameters:
saveCallback - Callback to be called

setOauthRestoreAccessToken

void setOauthRestoreAccessToken(RestoreAccessTokenCallback restoreCallback)
Set the callback to be called when the access token and secret need to be restored

Parameters:
restoreCallback - Callback to be called

getOauthSaveAccessToken

SaveAccessTokenCallback getOauthSaveAccessToken()
Get the callback to be called when the access token and secret need to be saved for later restoration


getOauthRestoreAccessToken

RestoreAccessTokenCallback getOauthRestoreAccessToken()
Get the callback to be called when the access token and secret need to be restored


getAccessTokenSecret

String getAccessTokenSecret()
Retrieves the accessTokenSecret


setAccessTokenSecret

void setAccessTokenSecret(String value)
Sets access token secret

Parameters:
value - an accessTokenSecret

getRequestToken

String getRequestToken()
Returns the request token


setRequestToken

void setRequestToken(String requestToken)
Sets the request token

Parameters:
requestToken - a request token

getRequestTokenSecret

String getRequestTokenSecret()
Gets the request token secret


setRequestTokenSecret

void setRequestTokenSecret(String requestTokenSecret)
Sets the request token secret


getConsumer

oauth.signpost.OAuthConsumer getConsumer()
Returns an OAuthConsumer for this adapter

Returns:
an instance of OAuthConsumer

setConsumer

void setConsumer(oauth.signpost.OAuthConsumer consumer)
Sets the OAuthConsumer

Parameters:
consumer - an instance of OAuthConsumer

reset

void reset()
Sets the adapter to a blank unauthorized state


getOauth1Manager

OAuth1Manager getOauth1Manager()
Gets an instance of OAuth1Manager serving this adapter

Returns:
an instance of OAuth1Manager


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.