com.google.api.client.googleapis.extensions.auth.helpers.oauth
Class GoogleOAuthHmacThreeLeggedFlow

java.lang.Object
  extended by com.google.api.client.googleapis.extensions.auth.helpers.oauth.GoogleOAuthHmacThreeLeggedFlow
All Implemented Interfaces:
ThreeLeggedFlow

public class GoogleOAuthHmacThreeLeggedFlow
extends Object
implements ThreeLeggedFlow

ThreeLeggedFlow implementation that will execute the proper requests to obtain an OAuth1 Credential object that can be used to sign requests.

This class is not thread safe, nor should you attempt to execute a flow from multiple threads simultaneously.

Since:
1.5
Author:
moshenko@google.com (Jacob Moshenko)

Constructor Summary
GoogleOAuthHmacThreeLeggedFlow(String userId, String consumerKey, String consumerSecret, String scope, String xoauthDisplayname, String callbackUrl, HttpTransport transport)
          Create an OAuthThreeLeggedFlow instance from the required information.
 
Method Summary
 Credential complete(String authorizationCode)
           
 String getAuthorizationUrl()
           
 Credential loadCredential(javax.jdo.PersistenceManager pm)
           
 void setHttpTransport(HttpTransport transport)
           
 void setJsonFactory(JsonFactory jsonFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleOAuthHmacThreeLeggedFlow

public GoogleOAuthHmacThreeLeggedFlow(String userId,
                                      String consumerKey,
                                      String consumerSecret,
                                      String scope,
                                      String xoauthDisplayname,
                                      String callbackUrl,
                                      HttpTransport transport)
                               throws IOException
Create an OAuthThreeLeggedFlow instance from the required information.

Parameters:
userId - Key that can be used to associate this flow with an end user.
consumerKey - Key that identifies the server to the service provider.
consumerSecret - Secret that is shared between the server and the service provider.
scope - OAuth scope for which the server is requesting access.
xoauthDisplayname - Display name to show the user when requesting access.
callbackUrl - Url which the server should redirect the user to after obtaining authorization.
Throws:
IOException - Exception thrown when the flow is unable to communicate with the service provider.
Method Detail

getAuthorizationUrl

public String getAuthorizationUrl()
Specified by:
getAuthorizationUrl in interface ThreeLeggedFlow

complete

public Credential complete(String authorizationCode)
                    throws IOException
Specified by:
complete in interface ThreeLeggedFlow
Throws:
IOException

loadCredential

public Credential loadCredential(javax.jdo.PersistenceManager pm)
Specified by:
loadCredential in interface ThreeLeggedFlow

setHttpTransport

public void setHttpTransport(HttpTransport transport)
Specified by:
setHttpTransport in interface ThreeLeggedFlow

setJsonFactory

public void setJsonFactory(JsonFactory jsonFactory)
Specified by:
setJsonFactory in interface ThreeLeggedFlow


Copyright © 2010-2011 Google. All Rights Reserved.