@Beta public final class ClientLogin extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientLogin.ErrorInfo
Key/value data to parse an error response.
|
static class |
ClientLogin.Response
Key/value data to parse a success response.
|
| Modifier and Type | Field and Description |
|---|---|
String |
accountType
Type of account to request authorization for.
|
String |
applicationName
Short string identifying your application for logging purposes of the form:
"companyName-applicationName-versionID".
|
String |
authTokenType
Name of the Google service you're requesting authorization for, for example
"cl" for
Google Calendar. |
String |
captchaAnswer
(optional) String entered by the user as an answer to a CAPTCHA challenge.
|
String |
captchaToken
(optional) Token representing the specific CAPTCHA challenge.
|
String |
password
User's password.
|
com.google.api.client.http.GenericUrl |
serverUrl
URL for the Client Login authorization server.
|
com.google.api.client.http.HttpTransport |
transport
HTTP transport required for executing request in
authenticate(). |
String |
username
User's full email address.
|
| Constructor and Description |
|---|
ClientLogin() |
| Modifier and Type | Method and Description |
|---|---|
ClientLogin.Response |
authenticate()
Authenticates based on the provided field values.
|
static String |
getAuthorizationHeaderValue(String authToken)
Returns Google Login
"Authorization" header value based on the given authentication
token. |
public com.google.api.client.http.HttpTransport transport
authenticate().public com.google.api.client.http.GenericUrl serverUrl
By default this is "https://www.google.com", but it may be overridden for testing
purposes.
public String applicationName
public String authTokenType
"cl" for
Google Calendar.public String username
public String password
public String accountType
public String captchaToken
public String captchaAnswer
public ClientLogin.Response authenticate() throws IOException
ClientLoginResponseException - if the authentication response has an error code, such as
for a CAPTCHA challenge.IOExceptionCopyright © 2010–2018 Google. All rights reserved.