com.google.api.client.googleapis.auth.clientlogin
Class ClientLogin

java.lang.Object
  extended by com.google.api.client.googleapis.auth.clientlogin.ClientLogin

public final class ClientLogin
extends Object

Client Login authentication method as described in ClientLogin for Installed Applications.

Since:
1.0
Author:
Yaniv Inbar

Nested Class Summary
static class ClientLogin.ErrorInfo
          Key/value data to parse an error response.
static class ClientLogin.Response
          Key/value data to parse a success response.
 
Field Summary
 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.
 GenericUrl serverUrl
          URL for the Client Login authorization server.
 HttpTransport transport
          HTTP transport required for executing request in authenticate().
 String username
          User's full email address.
 
Constructor Summary
ClientLogin()
           
 
Method Summary
 ClientLogin.Response authenticate()
          Authenticates based on the provided field values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transport

public HttpTransport transport
HTTP transport required for executing request in authenticate().

Since:
1.3

serverUrl

public GenericUrl serverUrl
URL for the Client Login authorization server.

By default this is "https://www.google.com", but it may be overridden for testing purposes.

Since:
1.3

applicationName

public String applicationName
Short string identifying your application for logging purposes of the form: "companyName-applicationName-versionID".


authTokenType

public String authTokenType
Name of the Google service you're requesting authorization for, for example "cl" for Google Calendar.


username

public String username
User's full email address.


password

public String password
User's password.


accountType

public String accountType
Type of account to request authorization for. Possible values are: Use HOSTED_OR_GOOGLE if you're not sure which type of account you want authorization for. If the user information matches both a hosted and a Google account, only the hosted account is authorized.

Since:
1.1

captchaToken

public String captchaToken
(optional) Token representing the specific CAPTCHA challenge.


captchaAnswer

public String captchaAnswer
(optional) String entered by the user as an answer to a CAPTCHA challenge.

Constructor Detail

ClientLogin

public ClientLogin()
Method Detail

authenticate

public ClientLogin.Response authenticate()
                                  throws ClientLoginResponseException,
                                         IOException
Authenticates based on the provided field values.

Upgrade warning: in prior version 1.6 it threw an HttpResponseException on error, but it now throws a ClientLoginResponseException.

Throws:
ClientLoginResponseException - if the authentication response has an error code, such as for a CAPTCHA challenge.
IOException - some other kind of I/O exception


Copyright © 2010-2012 Google. All Rights Reserved.