|
||||||||||
| 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.oauth2.draft10.OAuth2ThreeLeggedFlow
AuthorizationCodeFlow
@Deprecated public class OAuth2ThreeLeggedFlow
This class is designed to allow the three legged web app flow for OAuth2 to be accomplished easily. When the constructor is called an authorization url is generated from the provided information. The user should be redirected to that url for confirmation. When the code has been received, the flow will request the access and refresh tokens.
It is not safe to use one instance of this implementation from multiple threads.
| Constructor Summary | |
|---|---|
OAuth2ThreeLeggedFlow(String userId,
String clientId,
String clientSecret,
String scope,
String callbackUrl,
String authorizationEndpoint,
String tokenEndpoint)
Deprecated. Create the flow object with the information provided and create the authorization url. |
|
| Method Summary | |
|---|---|
Credential |
complete(String authorizationCode)
Deprecated. 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()
Deprecated. 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)
Deprecated. Convenience function that will load a credential based on the userId for which this flow was instantiated. |
void |
setHttpTransport(HttpTransport transport)
Deprecated. Set HttpTransport instance for this three legged flow. |
void |
setJsonFactory(JsonFactory jsonFactory)
Deprecated. 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 OAuth2ThreeLeggedFlow(String userId,
String clientId,
String clientSecret,
String scope,
String callbackUrl,
String authorizationEndpoint,
String tokenEndpoint)
userId - Key that will be used to associate this flow object with an end user.clientId - Used to identify the client server with the token server.clientSecret - Secret shared between the client server and the token server.scope - OAuth2 scope or space delimited list of scopes for which we require access.callbackUrl - Where the authorization should redirect the user to complete the flow.authorizationEndpoint - Server to which we will redirect the user to grant authorization.tokenEndpoint - Server with which we will exchange an authorization code for an access
token.| Method Detail |
|---|
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 String getAuthorizationUrl()
ThreeLeggedFlow
getAuthorizationUrl in interface ThreeLeggedFlowpublic 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 | |||||||||