org.mule.security.oauth
Interface OAuth1Manager

All Superinterfaces:
HttpCallbackAdapter
All Known Implementing Classes:
BaseOAuth1Manager

public interface OAuth1Manager
extends HttpCallbackAdapter


Method Summary
 String buildAuthorizeUrl(OAuth1Adapter adapter, Map<String,String> extraParameters, String requestTokenUrl, String accessTokenUrl, String authorizationUrl, String redirectUri)
          Builds the authorization url to initiate the OAuth dance
 void fetchAccessToken(OAuth1Adapter adapter, String requestTokenUrl, String accessTokenUrl, String authorizationUrl, String redirectUri)
          Retrieves the access token for the given adapter with the given parameters.
 void hasBeenAuthorized(OAuth1Adapter adapter)
          Determines if the adapter has been authorized or not by checking its access token
 void reset(OAuth1Adapter adapter)
          Sets the adapter to a blank, unatuhorized state
 boolean restoreAccessToken(OAuth1Adapter adapter)
          Restores the access token that belongs to the given adapter and sets its value into it.
 
Methods inherited from interface org.mule.security.oauth.callback.HttpCallbackAdapter
getAsync, getConnector, getDomain, getLocalPort, getPath, getRemotePort, setAsync, setConnector, setDomain, setLocalPort, setPath, setRemotePort
 

Method Detail

buildAuthorizeUrl

String buildAuthorizeUrl(OAuth1Adapter adapter,
                         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:
adapter - the adapter that is going to be authorized
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

restoreAccessToken

boolean restoreAccessToken(OAuth1Adapter adapter)
Restores the access token that belongs to the given adapter and sets its value into it. The restoration relies on the adapter's restore callback. If it isn't set, then no restoration is performed

Parameters:
adapter - the adapter which access token is to be restored
Returns:
true if the access token was succesfully restored. false otherwise.

fetchAccessToken

void fetchAccessToken(OAuth1Adapter adapter,
                      String requestTokenUrl,
                      String accessTokenUrl,
                      String authorizationUrl,
                      String redirectUri)
                      throws org.mule.common.security.oauth.exception.UnableToAcquireAccessTokenException
Retrieves the access token for the given adapter with the given parameters. The obtained token is set into the adapter

Parameters:
adapter - the adapter which access token you want
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

hasBeenAuthorized

void hasBeenAuthorized(OAuth1Adapter adapter)
                       throws org.mule.common.security.oauth.exception.NotAuthorizedException
Determines if the adapter has been authorized or not by checking its access token

Parameters:
adapter - the adapter to be checked
Throws:
org.mule.common.security.oauth.exception.NotAuthorizedException - if the adapter hasn't been authorized

reset

void reset(OAuth1Adapter adapter)
Sets the adapter to a blank, unatuhorized state

Parameters:
adapter - the adapter to be reset


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