Interface ThreeLeggedFlow
-
- All Known Implementing Classes:
OAuthHmacThreeLeggedFlow
@Beta public interface ThreeLeggedFlowBeta
Interface for auth flows that require a user authorization step through a web browser to obtain an authorization code.Implementations are required to be
PersistenceCapablefor storage in JDO compliant datastores during user authorization step.Warning: starting with version 1.7, usage of this for OAuth 2.0 is deprecated. Instead use
AuthorizationCodeFlow.- Since:
- 1.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Credentialcomplete(java.lang.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 aCredential.java.lang.StringgetAuthorizationUrl()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.CredentialloadCredential(javax.jdo.PersistenceManager pm)Convenience function that will load a credential based on the userId for which this flow was instantiated.voidsetHttpTransport(com.google.api.client.http.HttpTransport transport)SetHttpTransportinstance for this three legged flow.voidsetJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)SetJsonFactoryinstance for this three legged flow.
-
-
-
Method Detail
-
getAuthorizationUrl
java.lang.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.- Returns:
- URL to which the user should be directed
-
setHttpTransport
void setHttpTransport(com.google.api.client.http.HttpTransport transport)
SetHttpTransportinstance for this three legged flow.
-
setJsonFactory
void setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
SetJsonFactoryinstance for this three legged flow.
-
loadCredential
Credential loadCredential(javax.jdo.PersistenceManager pm)
Convenience function that will load a credential based on the userId for which this flow was instantiated.- Parameters:
pm-PersistenceManagerinstance which this flow should use to interact with the data store. The caller must remember to callPersistenceManager.close()after this method returns.- Returns:
- Fully initialized
Credentialobject ornullif none exists.
-
complete
Credential complete(java.lang.String authorizationCode) throws java.io.IOException
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 aCredential.- Parameters:
authorizationCode- Code or token obtained after the user grants permission- Returns:
Credentialobject that is obtained from token server- Throws:
java.io.IOException
-
-