com.google.api.client.auth.oauth2.draft10
Class AccessTokenRequest.RefreshTokenGrant

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.auth.oauth2.draft10.AccessTokenRequest
              extended by 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 Class Summary
 
Nested classes/interfaces inherited from class com.google.api.client.auth.oauth2.draft10.AccessTokenRequest
AccessTokenRequest.AssertionGrant, AccessTokenRequest.AuthorizationCodeGrant, AccessTokenRequest.GrantType, AccessTokenRequest.RefreshTokenGrant, AccessTokenRequest.ResourceOwnerPasswordCredentialsGrant
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
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.
 
Fields inherited from class com.google.api.client.auth.oauth2.draft10.AccessTokenRequest
authorizationServerUrl, clientId, clientSecret, grantType, jsonFactory, scope, transport, useBasicAuthorization
 
Fields inherited from class com.google.api.client.util.GenericData
unknownFields
 
Constructor Summary
AccessTokenRequest.RefreshTokenGrant()
           
AccessTokenRequest.RefreshTokenGrant(HttpTransport transport, JsonFactory jsonFactory, String authorizationServerUrl, String clientId, String clientSecret, String refreshToken)
           
 
Method Summary
 
Methods inherited from class com.google.api.client.auth.oauth2.draft10.AccessTokenRequest
execute, executeUnparsed
 
Methods inherited from class com.google.api.client.util.GenericData
clone, entrySet, get, put, putAll, remove, set
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

refreshToken

public String refreshToken
(REQUIRED) The refresh token associated with the access token to be refreshed.

Constructor Detail

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 URL
clientId - client identifier
clientSecret - client secret
refreshToken - refresh token associated with the access token to be refreshed


Copyright © 2010-2011 Google. All Rights Reserved.