| java.lang.Object | |
| ↳ | com.google.gdata.client.http.AuthSubUtil |
Utility functions to support AuthSub (Account Authentication for Web Applications).
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | DEFAULT_DOMAIN | ||||||||||
| String | DEFAULT_PROTOCOL | ||||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| RANDOM | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Exchanges the one time use token returned in the URL for a session
token.
| |||||||||||
Exchanges the one time use token returned in the URL for a session
token.
| |||||||||||
Forms the AuthSub authorization header.
| |||||||||||
Retrieves the private key from the specified keystore.
| |||||||||||
Creates the request URL to be used to retrieve an AuthSub token for
hosted applications.
| |||||||||||
Creates the request URL to be used to retrieve an AuthSub token.
| |||||||||||
Creates the request URL for to be used to retrieve an AuthSub token for
hosted applications.
| |||||||||||
Creates the request URL to be used to retrieve an AuthSub token.
| |||||||||||
Parses and returns the AuthSub token returned by Google on a successful
AuthSub login request.
| |||||||||||
Parses and returns the AuthSub token returned by Google on a successful
AuthSub login request.
| |||||||||||
Retrieves information about the AuthSub token.
| |||||||||||
Retrieves information about the AuthSub token.
| |||||||||||
Revokes the specified token.
| |||||||||||
Revokes the specified token.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Exchanges the one time use token returned in the URL for a session token.
If the key is non-null, the token will be used securely
and the request to make the exchange will be signed.
| onetimeUseToken | The one time use token sent by Google in the URL |
|---|---|
| key | The private key to sign the request |
null if the request failed| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if one time use token is rejected |
Exchanges the one time use token returned in the URL for a session token.
If the key is non-null, the token will be used securely
and the request to make the exchange will be signed.
| protocol | The protocol to use to communicate with the server |
|---|---|
| domain | The domain at which the authentication server exists |
| onetimeUseToken | The one time use token sent by Google in the URL |
| key | The private key to sign the request |
null if the request failed| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if one time use token is rejected |
Forms the AuthSub authorization header.
If the key is null, the token will be used in insecure mode.
If the key is non-null, the token will be used securely and
the header will contain a signature.
| token | The AuthSub token to use in the header |
|---|---|
| key | The private key used to sign the request |
| requestUrl | The URL of the request being issued |
| requestMethod | The HTTP method being used to issue the request |
| GeneralSecurityException | if error occurs while creating signature |
|---|
Retrieves the private key from the specified keystore.
| keystore | The path to the keystore file |
|---|---|
| keystorePass | The password that protects the keystore file |
| keyAlias | The alias under which the private key is stored |
| keyPass | The password protecting the private key |
| GeneralSecurityException | if the keystore cannot be loaded |
|---|---|
| IOException | if the file cannot be accessed |
Creates the request URL to be used to retrieve an AuthSub token for hosted applications.
On success, the user will be redirected to the next URL with the
AuthSub token appended to the URL. Use getTokenFromReply(String)
to retrieve the token from the reply.
| hostedDomain | Hosted domain name, for example
mydomain.example.com |
|---|---|
| nextUrl | The URL to redirect to on successful token retrieval |
| scope | The scope of the requested AuthSub token |
| secure | true if the token will be used securely |
| session | true if the token will be exchanged for a
session cookie |
Creates the request URL to be used to retrieve an AuthSub token.
On success, the user will be redirected to the next URL with the
AuthSub token appended to the URL. Use getTokenFromReply(String)
to retrieve the token from the reply.
| protocol | The protocol to use to communicate with the server |
|---|---|
| domain | The domain at which the authentication server exists |
| nextUrl | The URL to redirect to on successful token retrieval |
| scope | The scope of the requested AuthSub token |
| secure | true if the token will be used securely |
| session | true if the token will be exchanged for a
session cookie |
Creates the request URL for to be used to retrieve an AuthSub token for hosted applications.
On success, the user will be redirected to the next URL with the
AuthSub token appended to the URL. Use getTokenFromReply(String)
to retrieve the token from the reply.
| protocol | The protocol to use to communicate with the server |
|---|---|
| domain | The domain at which the authentication server exists |
| hostedDomain | Hosted domain name, for example
mydomain.example.com |
| nextUrl | The URL to redirect to on successful token retrieval |
| scope | The scope of the requested AuthSub token |
| secure | true if the token will be used securely |
| session | true if the token will be exchanged for a
session cookie |
Creates the request URL to be used to retrieve an AuthSub token.
On success, the user will be redirected to the next URL with the
AuthSub token appended to the URL. Use getTokenFromReply(String)
to retrieve the token from the reply.
| nextUrl | The URL to redirect to on successful token retrieval |
|---|---|
| scope | The scope of the requested AuthSub token |
| secure | true if the token will be used securely |
| session | true if the token will be exchanged for a
session cookie |
Parses and returns the AuthSub token returned by Google on a successful AuthSub login request. The token will be appended as a query parameter to the "next" URL specified while making the AuthSub request.
| queryString | The query portion of the redirected-to URL containing
the token (as the server received it; i.e. what
httpServletRequest.getQueryString() returns) |
|---|
null if there is no
token present in queryString. The token text will have
been run through URLDecoder already, and will not need any
additional decoding before use; however, the token string will
not contain percent (%) characters and therefore
additional url-decoding will do no harm.
Parses and returns the AuthSub token returned by Google on a successful AuthSub login request. The token will be appended as a query parameter to the next URL specified while making the AuthSub request.
| url | The redirected-to next URL with the token |
|---|
Retrieves information about the AuthSub token.
If the key is non-null, the token will be used securely
and the request to revoke the token will be signed.
| protocol | The protocol to use to communicate with the server |
|---|---|
| domain | The domain at which the authentication server exists |
| token | The AuthSub token for which to receive information |
| key | The private key to sign the request |
| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if the token is rejected |
Retrieves information about the AuthSub token.
If the key is non-null, the token will be used securely
and the request to revoke the token will be signed.
| token | The AuthSub token for which to receive information |
|---|---|
| key | The private key to sign the request |
| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if the token is rejected |
Revokes the specified token.
If the key is non-null, the token will be used securely
and the request to revoke the token will be signed.
| protocol | The protocol to use to communicate with the server |
|---|---|
| domain | The domain at which the authentication server exists |
| token | The AuthSub token to revoke |
| key | The private key to sign the request |
| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if the token is rejected |
Revokes the specified token.
If the key is non-null, the token will be used securely
and the request to revoke the token will be signed.
| token | The AuthSub token to revoke |
|---|---|
| key | The private key to sign the request |
| IOException | if error in writing/reading the request |
|---|---|
| GeneralSecurityException | if error in signing the request |
| AuthenticationException | if the token is rejected |