Url which the server should redirect the user to after obtaining
authorization.
transport
com.google.api.client.http.HttpTransport
Methods
complete(String authorizationCode)
publicCredentialcomplete(StringauthorizationCode)
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Class OAuthHmacThreeLeggedFlow (1.39.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.39.0 (latest)](/java/docs/reference/google-oauth-client/latest/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.38.2](/java/docs/reference/google-oauth-client/1.38.2/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.37.0](/java/docs/reference/google-oauth-client/1.37.0/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.36.0](/java/docs/reference/google-oauth-client/1.36.0/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.34.1](/java/docs/reference/google-oauth-client/1.34.1/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.33.3](/java/docs/reference/google-oauth-client/1.33.3/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow)\n- [1.32.1](/java/docs/reference/google-oauth-client/1.32.1/com.google.api.client.extensions.auth.helpers.oauth.OAuthHmacThreeLeggedFlow) \n\n public class OAuthHmacThreeLeggedFlow implements ThreeLeggedFlow\n\nBeta \n\n[ThreeLeggedFlow](/java/docs/reference/google-oauth-client/latest/com.google.api.client.extensions.auth.helpers.ThreeLeggedFlow) implementation that will execute the proper requests to obtain an OAuth1\nCredential object that can be used to sign requests.\n\nThis class is not thread safe, nor should you attempt to execute a flow from multiple threads\nsimultaneously. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e OAuthHmacThreeLeggedFlow \n\nImplements\n----------\n\n[ThreeLeggedFlow](/java/docs/reference/google-oauth-client/latest/com.google.api.client.extensions.auth.helpers.ThreeLeggedFlow) \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### OAuthHmacThreeLeggedFlow(String userId, String consumerKey, String consumerSecret, String authorizationServerUrl, String temporaryTokenUrl, String callbackUrl, HttpTransport transport)\n\n public OAuthHmacThreeLeggedFlow(String userId, String consumerKey, String consumerSecret, String authorizationServerUrl, String temporaryTokenUrl, String callbackUrl, HttpTransport transport)\n\nCreate an OAuthThreeLeggedFlow instance from the required information.\n\nMethods\n-------\n\n### complete(String authorizationCode)\n\n public Credential complete(String authorizationCode)\n\nAfter the user has authorized the request, the token or code obtained should be passed to this\ncomplete function to allow us to exchange the code with the authentication server for a [Credential](/java/docs/reference/google-oauth-client/latest/com.google.api.client.extensions.auth.helpers.Credential).\n\n### getAuthorizationUrl()\n\n public String getAuthorizationUrl()\n\nAfter the object is created, the developer should use this method to interrogate it for the\nauthorization URL to which the user should be redirected to obtain permission.\n\n### loadCredential(PersistenceManager pm)\n\n public Credential loadCredential(PersistenceManager pm)\n\nConvenience function that will load a credential based on the userId for which this flow was\ninstantiated.\n\n### setHttpTransport(HttpTransport transport)\n\n public void setHttpTransport(HttpTransport transport)\n\nSet HttpTransport instance for this three legged flow.\n\n### setJsonFactory(JsonFactory jsonFactory)\n\n public void setJsonFactory(JsonFactory jsonFactory)\n\nSet JsonFactory instance for this three legged flow."]]