[[["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 TokenResponse (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.auth.oauth2.TokenResponse)\n- [1.38.2](/java/docs/reference/google-oauth-client/1.38.2/com.google.api.client.auth.oauth2.TokenResponse)\n- [1.37.0](/java/docs/reference/google-oauth-client/1.37.0/com.google.api.client.auth.oauth2.TokenResponse)\n- [1.36.0](/java/docs/reference/google-oauth-client/1.36.0/com.google.api.client.auth.oauth2.TokenResponse)\n- [1.34.1](/java/docs/reference/google-oauth-client/1.34.1/com.google.api.client.auth.oauth2.TokenResponse)\n- [1.33.3](/java/docs/reference/google-oauth-client/1.33.3/com.google.api.client.auth.oauth2.TokenResponse)\n- [1.32.1](/java/docs/reference/google-oauth-client/1.32.1/com.google.api.client.auth.oauth2.TokenResponse) \n\n public class TokenResponse extends GenericJson\n\nOAuth 2.0 JSON model for a successful access token response as specified in [Successful Response](http://tools.ietf.org/html/rfc6749#section-5.1).\n\nImplementation is not thread-safe. \n\nInheritance\n-----------\n\n[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e java.util.AbstractMap \\\u003e com.google.api.client.util.GenericData \\\u003e com.google.api.client.json.GenericJson \\\u003e TokenResponse \n\nInherited Members\n-----------------\n\ncom.google.api.client.json.GenericJson.clone() \ncom.google.api.client.json.GenericJson.getFactory() \ncom.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object) \ncom.google.api.client.json.GenericJson.setFactory(com.google.api.client.json.JsonFactory) \ncom.google.api.client.json.GenericJson.toPrettyString() \ncom.google.api.client.json.GenericJson.toString() \ncom.google.api.client.util.GenericData.entrySet() \ncom.google.api.client.util.GenericData.equals(java.lang.Object) \ncom.google.api.client.util.GenericData.get(java.lang.Object) \ncom.google.api.client.util.GenericData.getClassInfo() \ncom.google.api.client.util.GenericData.getUnknownKeys() \ncom.google.api.client.util.GenericData.hashCode() \ncom.google.api.client.util.GenericData.put(java.lang.String,java.lang.Object) \ncom.google.api.client.util.GenericData.putAll(java.util.Map\\\u003c? extends java.lang.String,?\\\u003e) \ncom.google.api.client.util.GenericData.remove(java.lang.Object) \ncom.google.api.client.util.GenericData.setUnknownKeys(java.util.Map\\\u003cjava.lang.String,java.lang.Object\\\u003e) \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.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.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[AbstractMap.clear()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#clear--) \n[AbstractMap.containsKey(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsKey-java.lang.Object-) \n[AbstractMap.containsValue(Object)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#containsValue-java.lang.Object-) \n[AbstractMap.isEmpty()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#isEmpty--) \n[AbstractMap.keySet()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#keySet--) \n[AbstractMap.put(K,V)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#put-K-V-) \n[AbstractMap.putAll(Map\\\u003c? extends K,? extends V\\\u003e)](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#putAll-java.util.Map\u003c? extends K-? extends V\u003e-) \n[AbstractMap.size()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#size--) \n[AbstractMap.values()](https://docs.oracle.com/javase/8/docs/api/java/util/AbstractMap.html#values--)\n\nConstructors\n------------\n\n### TokenResponse()\n\n public TokenResponse()\n\nMethods\n-------\n\n### clone()\n\n public TokenResponse clone()\n\n**Overrides** \ncom.google.api.client.json.GenericJson.clone()\n\n### getAccessToken()\n\n public String getAccessToken()\n\nReturns the access token issued by the authorization server.\n\n### getExpiresInSeconds()\n\n public Long getExpiresInSeconds()\n\nReturns the lifetime in seconds of the access token (for example 3600 for an hour) or `\nnull` for none.\n\n### getRefreshToken()\n\n public String getRefreshToken()\n\nReturns the refresh token which can be used to obtain new access tokens using the same\nauthorization grant or `null` for none.\n\n### getScope()\n\n public String getScope()\n\nReturns the scope of the access token or `null` for none.\n\n### getTokenType()\n\n public String getTokenType()\n\nReturns the token type (as specified in [Access Token Types](http://tools.ietf.org/html/rfc6749#section-7.1)).\n\n### set(String fieldName, Object value)\n\n public TokenResponse set(String fieldName, Object value)\n\n**Overrides** \ncom.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)\n\n### setAccessToken(String accessToken)\n\n public TokenResponse setAccessToken(String accessToken)\n\nSets the access token issued by the authorization server.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### setExpiresInSeconds(Long expiresInSeconds)\n\n public TokenResponse setExpiresInSeconds(Long expiresInSeconds)\n\nSets the lifetime in seconds of the access token (for example 3600 for an hour) or `null`\nfor none.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### setRefreshToken(String refreshToken)\n\n public TokenResponse setRefreshToken(String refreshToken)\n\nSets the refresh token which can be used to obtain new access tokens using the same\nauthorization grant or `null` for none.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### setScope(String scope)\n\n public TokenResponse setScope(String scope)\n\nSets the scope of the access token or `null` for none.\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else.\n\n### setTokenType(String tokenType)\n\n public TokenResponse setTokenType(String tokenType)\n\nSets the token type (as specified in [Access Token Types](http://tools.ietf.org/html/rfc6749#section-7.1)).\n\nOverriding is only supported for the purpose of calling the super implementation and\nchanging the return type, but nothing else."]]