Google's additions to OAuth 1.0a authorization as specified in Google's OAuth API Reference (see detailed package specification).

Package Specification

Before using this library, you need to set up your application as follows:

  1. For a web application, you should first register your application at the Manage Your Domains page. See detailed instructions at the registration page. Take note of the following OAuth information you will need:
  2. For an installed application, an unregistered web application, or a web application running on localhost, you must use the {@code "HMAC-SHA1"} signature method. Use {@code "anonymous"} for the {@code consumerKey} and {@code clientSharedSecret}.

After the set up has been completed, the typical application flow is:

  1. Request a temporary credentials token ("request token") from the Google Authorization server using {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthGetTemporaryToken}. A callback URL should be specified for web applications, but does not need to be specified for installed applications.
  2. Direct the end user to a Google Accounts web page to allow the end user to authorize the temporary token using using {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthAuthorizeTemporaryTokenUrl}.
  3. After the user has granted the authorization:
  4. Request to exchange the temporary token for a long-lived access token from the Google Authorization server using {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthGetAccessToken}. This access token must be stored.
  5. Use the stored access token to authorize HTTP requests to protected resources in Google services by setting the {@link com.google.api.client.auth.oauth.OAuthParameters#token} and invoking {@link com.google.api.client.auth.oauth.OAuthParameters#signRequestsUsingAuthorizationHeader}.
  6. For 2-legged OAuth, use {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthDomainWideDelegation} as a request execute intercepter to set the e-mail address of the user on every HTTP request, or {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthDomainWideDelegation.Url} as a generic URL builder with the requestor ID parameter.
  7. To revoke an access token, use {@link com.google.api.client.googleapis.auth.oauth.GoogleOAuthGetAccessToken#revokeAccessToken}. Users can also manually revoke tokens from Google's change authorized websites page.

This package depends on theses packages:

Warning: this package is experimental, and its content may be changed in incompatible ways or possibly entirely removed in a future version of the library

@since 1.0