|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.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.ResourceOwnerPasswordCredentialsGrant
public static class AccessTokenRequest.ResourceOwnerPasswordCredentialsGrant
OAuth 2.0 Username and Password Flow: request an access token based on resource owner credentials used in the as specified in Resource Owner Password Credentials.
Sample usage:
static void requestAccessToken() throws IOException {
try {
ResourceOwnerPasswordCredentialsGrant request =
new ResourceOwnerPasswordCredentialsGrant(new NetHttpTransport(),
new JacksonFactory(),
"https://server.example.com/authorize",
"s6BhdRkqt3",
"gX1fBat3bV",
"johndoe",
"A3ddj3w");
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 |
password
(REQUIRED) The resource owner's password. |
String |
username
(REQUIRED) The resource owner's username. |
| 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.ResourceOwnerPasswordCredentialsGrant()
|
|
AccessTokenRequest.ResourceOwnerPasswordCredentialsGrant(HttpTransport transport,
JsonFactory jsonFactory,
String authorizationServerUrl,
String clientId,
String clientSecret,
String username,
String password)
|
|
| 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 |
|---|
public String username
public String password
| Constructor Detail |
|---|
public AccessTokenRequest.ResourceOwnerPasswordCredentialsGrant()
public AccessTokenRequest.ResourceOwnerPasswordCredentialsGrant(HttpTransport transport,
JsonFactory jsonFactory,
String authorizationServerUrl,
String clientId,
String clientSecret,
String username,
String password)
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 secretusername - resource owner's usernamepassword - resource owner's password
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||