public class Oauth2 extends AbstractGoogleJsonClient
Obtains end-user authorization grants for use with other Google APIs.
For more information about this service, see the API Documentation
This service uses Oauth2RequestInitializer
to initialize global parameters via its
Oauth2.Builder
.
Modifier and Type | Class and Description |
---|---|
static class |
Oauth2.Builder
Builder for
Oauth2 . |
class |
Oauth2.Tokeninfo |
class |
Oauth2.Userinfo
The "userinfo" collection of methods.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_BASE_URL
The default encoded base URL of the service.
|
static String |
DEFAULT_BATCH_PATH
The default encoded batch path of the service.
|
static String |
DEFAULT_MTLS_ROOT_URL
The default encoded mTLS root URL of the service.
|
static String |
DEFAULT_ROOT_URL
The default encoded root URL of the service.
|
static String |
DEFAULT_SERVICE_PATH
The default encoded service path of the service.
|
Constructor and Description |
---|
Oauth2(HttpTransport transport,
JsonFactory jsonFactory,
HttpRequestInitializer httpRequestInitializer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
initialize(AbstractGoogleClientRequest<?> httpClientRequest) |
Oauth2.Tokeninfo |
tokeninfo()
Create a request for the method "tokeninfo".
|
Oauth2.Userinfo |
userinfo()
An accessor for creating requests from the Userinfo collection.
|
getJsonFactory, getObjectParser
batch, batch, getApplicationName, getBaseUrl, getGoogleClientRequestInitializer, getRequestFactory, getRootUrl, getServicePath, getSuppressPatternChecks, getSuppressRequiredParameterChecks
public static final String DEFAULT_ROOT_URL
public static final String DEFAULT_MTLS_ROOT_URL
public static final String DEFAULT_SERVICE_PATH
public static final String DEFAULT_BATCH_PATH
public static final String DEFAULT_BASE_URL
public Oauth2(HttpTransport transport, JsonFactory jsonFactory, HttpRequestInitializer httpRequestInitializer)
Use Oauth2.Builder
if you need to specify any of the optional parameters.
transport
- HTTP transport, which should normally be:
com.google.api.client.extensions.appengine.http.UrlFetchTransport
newCompatibleTransport
from
com.google.api.client.extensions.android.http.AndroidHttp
GoogleNetHttpTransport
jsonFactory
- JSON factory, which may be:
com.google.api.client.json.jackson2.JacksonFactory
com.google.api.client.json.gson.GsonFactory
com.google.api.client.extensions.android.json.AndroidJsonFactory
httpRequestInitializer
- HTTP request initializer or null
for noneprotected void initialize(AbstractGoogleClientRequest<?> httpClientRequest) throws IOException
initialize
in class AbstractGoogleClient
IOException
public Oauth2.Userinfo userinfo()
The typical use is:
Oauth2 oauth2 = new Oauth2(...);
Oauth2.Userinfo.List request = oauth2.userinfo().list(parameters ...)
public Oauth2.Tokeninfo tokeninfo() throws IOException
AbstractGoogleClientRequest.execute()
method to invoke the remote operation.IOException
Copyright © 2011–2022 Google. All rights reserved.