|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow
public class OAuthHmacThreeLeggedFlow
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.
| Constructor Summary | |
|---|---|
OAuthHmacThreeLeggedFlow(String userId,
String consumerKey,
String consumerSecret,
String authorizationServerUrl,
String temporaryTokenUrl,
String callbackUrl,
HttpTransport transport)
Create an OAuthThreeLeggedFlow instance from the required information. |
|
| Method Summary | |
|---|---|
Credential |
complete(String authorizationCode)
After the user has authorized the request, the token or code obtained should be passed to this complete function to allow us to exchange the code with the authentication server for a Credential. |
String |
getAuthorizationUrl()
After the object is created, the developer should use this method to interrogate it for the authorization URL to which the user should be redirected to obtain permission. |
Credential |
loadCredential(javax.jdo.PersistenceManager pm)
Convenience function that will load a credential based on the userId for which this flow was instantiated. |
void |
setHttpTransport(HttpTransport transport)
Set HttpTransport instance for this three legged flow. |
void |
setJsonFactory(JsonFactory jsonFactory)
Set JsonFactory instance for this three legged flow. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OAuthHmacThreeLeggedFlow(String userId,
String consumerKey,
String consumerSecret,
String authorizationServerUrl,
String temporaryTokenUrl,
String callbackUrl,
HttpTransport transport)
throws IOException
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.authorizationServerUrl - Url with which we communicate to authorize tis application.temporaryTokenUrl - Url which we will use to obtain a temporary token.callbackUrl - Url which the server should redirect the user to after obtaining
authorization.
IOException - Exception thrown when the flow is unable to communicate with the service
provider.| Method Detail |
|---|
public String getAuthorizationUrl()
ThreeLeggedFlow
getAuthorizationUrl in interface ThreeLeggedFlow
public Credential complete(String authorizationCode)
throws IOException
ThreeLeggedFlowCredential.
complete in interface ThreeLeggedFlowauthorizationCode - Code or token obtained after the user grants permission
Credential object that is obtained from token server
IOException - When an error occurs when communicating with the token serverpublic Credential loadCredential(javax.jdo.PersistenceManager pm)
ThreeLeggedFlow
loadCredential in interface ThreeLeggedFlowpm - PersistenceManager instance which this flow should use to interact with the
data store. The caller must remember to call PersistenceManager.close() after
this method returns.
Credential object or null if none exists.public void setHttpTransport(HttpTransport transport)
ThreeLeggedFlowHttpTransport instance for this three legged flow.
setHttpTransport in interface ThreeLeggedFlowpublic void setJsonFactory(JsonFactory jsonFactory)
ThreeLeggedFlowJsonFactory instance for this three legged flow.
setJsonFactory in interface ThreeLeggedFlow
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||