| java.lang.Object | |
| ↳ | com.google.gdata.client.GoogleAuthTokenFactory |
A factory for creating Google authentication tokens (ClientLogin and AuthSub).
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| GoogleAuthTokenFactory.AuthSubToken | Encapsulates the token used by web applications to login on behalf of a user. | ||||||||||
| GoogleAuthTokenFactory.OAuth2Token | Encapsulates the OAuth 2.0 information used by applications to login on behalf of a user. | ||||||||||
| GoogleAuthTokenFactory.OAuthToken | Encapsulates the OAuth information used by applications to login on behalf of a user. | ||||||||||
| GoogleAuthTokenFactory.UserToken | The UserToken encapsulates the token retrieved as a result of authenticating to Google using a user's credentials. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | GOOGLE_ACCOUNTS_PATH | The path name of the Google accounts management handler. | |||||||||
| String | GOOGLE_LOGIN_PATH | The path name of the Google login handler. | |||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| applicationName | |||||||||||
| authToken | |||||||||||
| domainName | |||||||||||
| loginProtocol | |||||||||||
| password | |||||||||||
| serviceName | |||||||||||
| tokenListener | |||||||||||
| username | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a factory for creating authentication tokens for connecting
to a Google service with name
serviceName for an application
with the name applicationName. | |||||||||||
Constructs a factory for creating authentication tokens for connecting
to a Google service with name
serviceName for an application
with the name applicationName. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Retrieves the authentication token for the provided set of credentials.
| |||||||||||
Get an authentication token.
| |||||||||||
Retrieves the authentication token for the provided set of credentials for
either a Google or a hosted domain.
| |||||||||||
Handles a session expired exception.
| |||||||||||
Makes a HTTP POST request to the provided
url given the
provided parameters. | |||||||||||
Sets the AuthSub token to be used to authenticate a user.
| |||||||||||
Sets the AuthSub token to be used to authenticate a user.
| |||||||||||
Set the authentication token.
| |||||||||||
Sets the OAuth 2.0 credentials used to generate the authorization header.
| |||||||||||
Sets the OAuth credentials used to generate the authorization header.
| |||||||||||
Sets the credentials of the user to authenticate requests to the server.
| |||||||||||
Sets the credentials of the user to authenticate requests to the server.
| |||||||||||
Sets the credentials of the user to authenticate requests to the server.
| |||||||||||
Sets the credentials of the user to authenticate requests to the server.
| |||||||||||
Sets the AuthToken that should be used to authenticate requests to the
server.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.gdata.client.AuthTokenFactory
| |||||||||||
The path name of the Google accounts management handler.
The path name of the Google login handler.
Constructs a factory for creating authentication tokens for connecting
to a Google service with name serviceName for an application
with the name applicationName. The default domain
(www.google.com) will be used to authenticate.
| serviceName | The name of the Google service to which we are connecting. Sample names of services might include "cl" (Calendar), "mail" (GMail), or "blogger" (Blogger) |
|---|---|
| applicationName | The name of the client application accessing the service. Application names should preferably have the format [company-id]-[app-name]-[app-version]. The name will be used by the Google servers to monitor the source of authentication. |
| tokenListener | Listener for token changes |
Constructs a factory for creating authentication tokens for connecting
to a Google service with name serviceName for an application
with the name applicationName. The service will authenticate
at the provided domainName.
| serviceName | The name of the Google service to which we are connecting. Sample names of services might include "cl" (Calendar), "mail" (GMail), or "blogger" (Blogger) |
|---|---|
| applicationName | The name of the client application accessing the service. Application names should preferably have the format [company-id]-[app-name]-[app-version]. The name will be used by the Google servers to monitor the source of authentication. |
| protocol | Name of protocol to use for authentication ("http"/"https") |
| domainName | The name of the domain hosting the login handler |
| tokenListener | Listener for token changes |
Retrieves the authentication token for the provided set of credentials.
| username | The name of the user (an email address) |
|---|---|
| password | The password of the user |
| captchaToken | The CAPTCHA token if CAPTCHA is required (Optional) |
| captchaAnswer | The respective answer of the CAPTCHA token (Optional) |
| serviceName | The name of the service to which a token is required |
| applicationName | The application requesting the token |
| accountType | The account type: HOSTED, GOOGLE, or HOSTED_OR_GOOGLE |
| AuthenticationException | if authentication failed |
|---|
Retrieves the authentication token for the provided set of credentials for either a Google or a hosted domain.
| username | The name of the user (an email address) |
|---|---|
| password | The password of the user |
| captchaToken | The CAPTCHA token if CAPTCHA is required (Optional) |
| captchaAnswer | The respective answer of the CAPTCHA token (Optional) |
| serviceName | The name of the service to which a token is required |
| applicationName | The application requesting the token |
| AuthenticationException | if authentication failed |
|---|
Handles a session expired exception.
| sessionExpired |
|---|
Makes a HTTP POST request to the provided url given the
provided parameters. It returns the output from the POST
handler as a String object.
| url | The URL to post the request |
|---|---|
| parameters | The parameters to post to the handler |
| IOException | if an I/O exception occurs while creating, writing, or reading the request |
|---|
Sets the AuthSub token to be used to authenticate a user.
| token | The AuthSub token retrieved from Google |
|---|
Sets the AuthSub token to be used to authenticate a user. The token will be used in secure-mode, and the provided private key will be used to sign all requests.
| token | The AuthSub token retrieved from Google |
|---|---|
| key | The private key to be used to sign all requests |
Set the authentication token.
| authToken | Authentication token |
|---|
Sets the OAuth 2.0 credentials used to generate the authorization header.
| credential | The OAuth 2.0 credentials to use to generate the header |
|---|
Sets the OAuth credentials used to generate the authorization header. The following OAuth parameters are required:
| parameters | The OAuth parameters to use to generate the header |
|---|---|
| signer | The signing method to use for signing the header |
| OAuthException |
|---|
Sets the credentials of the user to authenticate requests to the server. A CAPTCHA token and a CAPTCHA answer can also be optionally provided to authenticate when the authentication server requires that a CAPTCHA be answered.
| username | The name of the user (an email id) |
|---|---|
| password | The password of the user |
| captchaToken | The CAPTCHA token issued by the server |
| captchaAnswer | The answer to the respective CAPTCHA token |
| AuthenticationException | if authentication failed |
|---|
Sets the credentials of the user to authenticate requests to the server.
| username | The name of the user (an email address) |
|---|---|
| password | The password of the user |
| AuthenticationException | if authentication failed. |
|---|
Sets the credentials of the user to authenticate requests to the server.
| username | The name of the user (an email address) |
|---|---|
| password | The password of the user |
| accountType | The account type: HOSTED, GOOGLE, or HOSTED_OR_GOOGLE |
| AuthenticationException | if authentication failed. |
|---|
Sets the credentials of the user to authenticate requests to the server. A CAPTCHA token and a CAPTCHA answer can also be optionally provided to authenticate when the authentication server requires that a CAPTCHA be answered.
| username | The name of the user (an email id) |
|---|---|
| password | The password of the user |
| captchaToken | The CAPTCHA token issued by the server |
| captchaAnswer | The answer to the respective CAPTCHA token |
| accountType | The account type: HOSTED, GOOGLE, or HOSTED_OR_GOOGLE |
| AuthenticationException | if authentication failed |
|---|
Sets the AuthToken that should be used to authenticate requests to the server. This is useful if the caller has some other way of accessing the AuthToken, versus calling getAuthToken with credentials to request the AuthToken using ClientLogin.
| token | The AuthToken in ascii form |
|---|