com.google.api.client.googleapis.auth.oauth2.draft10
Class GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant
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.AuthorizationCodeGrant
com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant
- All Implemented Interfaces:
- Cloneable, Map<String,Object>
- Enclosing class:
- GoogleAccessTokenRequest
Deprecated. (scheduled to be removed in 1.9) Use
GoogleAuthorizationCodeTokenRequest
@Deprecated
public static class GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant
- extends AccessTokenRequest.AuthorizationCodeGrant
Google extension to the OAuth 2.0 Web Server Flow: request an access token based on a
verification code.
Sample usage:
static void requestAccessToken() throws IOException {
try {
GoogleAuthorizationCodeGrant request =
new GoogleAuthorizationCodeGrant(new NetHttpTransport(),
new JacksonFactory(),
"s6BhdRkqt3",
"gX1fBat3bV",
"i1WsRn1uB1",
"https://client.example.com/cb");
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> |
GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant
public GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant()
- Deprecated.
GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant
public GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant(HttpTransport transport,
JsonFactory jsonFactory,
String clientId,
String clientSecret,
String code,
String redirectUri)
- Deprecated.
- Parameters:
transport
- HTTP transport required for executing request in AccessTokenRequest.execute()
jsonFactory
- JSON factory to use for parsing response in AccessTokenRequest.execute()
clientId
- client identifierclientSecret
- String clientSecretcode
- authorization code received from the authorization serverredirectUri
- redirection URI used in the initial request
Copyright © 2010-2012 Google. All Rights Reserved.