com.google.api.client.auth.oauth2.draft10
Class AccessTokenRequest.RefreshTokenGrant
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.auth.oauth2.draft10.AccessTokenRequest
com.google.api.client.auth.oauth2.draft10.AccessTokenRequest.RefreshTokenGrant
- All Implemented Interfaces:
- Cloneable, Map<String,Object>
- Enclosing class:
- AccessTokenRequest
public static class AccessTokenRequest.RefreshTokenGrant
- extends AccessTokenRequest
OAuth 2.0 request to refresh an access token as specified in Refresh Token.
Sample usage:
static void requestAccessToken() throws IOException {
try {
RefreshTokenGrant request = new RefreshTokenGrant(new NetHttpTransport(),
new JacksonFactory(),
"https://server.example.com/authorize",
"s6BhdRkqt3",
"gX1fBat3bV",
"n4E9O119d");
AccessTokenResponse response = request.execute();
System.out.println("Access token: " + response.accessToken);
} catch (HttpResponseException e) {
AccessTokenErrorResponse response = e.response.parseAs(AccessTokenErrorResponse.class);
System.out.println("Error: " + response.error);
}
}
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
|
Field Summary |
String |
refreshToken
(REQUIRED) The refresh token associated with the access token to be refreshed. |
refreshToken
public String refreshToken
- (REQUIRED) The refresh token associated with the access token to be refreshed.
AccessTokenRequest.RefreshTokenGrant
public AccessTokenRequest.RefreshTokenGrant()
AccessTokenRequest.RefreshTokenGrant
public AccessTokenRequest.RefreshTokenGrant(HttpTransport transport,
JsonFactory jsonFactory,
String authorizationServerUrl,
String clientId,
String clientSecret,
String refreshToken)
- Parameters:
transport - HTTP transport for executing request in AccessTokenRequest.execute()jsonFactory - JSON factory to use for parsing response in AccessTokenRequest.execute()authorizationServerUrl - encoded authorization server URLclientId - client identifierclientSecret - client secretrefreshToken - refresh token associated with the access token to be refreshed
Copyright © 2010-2011 Google. All Rights Reserved.