# Google Data APIs Client Library (1.43.0)

## com.google.gdata.client
Class GoogleAuthTokenFactory.OAuthToken

    java.lang.Object
      com.google.gdata.client.GoogleAuthTokenFactory.OAuthToken

All Implemented Interfaces:
  AuthTokenFactory.AuthToken, HttpAuthToken

Enclosing class:
  GoogleAuthTokenFactory

    public static class GoogleAuthTokenFactory.OAuthToken

extends java.lang.Object
implements HttpAuthToken

Encapsulates the OAuth information used by applications to login on behalf of a user. This class generates an unique authorization header for each request.

Constructor Summary
`GoogleAuthTokenFactory.OAuthToken(OAuthParameters parameters, OAuthSigner signer)` Create a new `GoogleAuthTokenFactory.OAuthToken` object.

Method Summary
`java.lang.String` `getAuthorizationHeader(java.net.URL requestUrl, java.lang.String requestMethod)` Generates the OAuth authorization header using the user's OAuth parameters, the request url and the request method.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GoogleAuthTokenFactory.OAuthToken

    public GoogleAuthTokenFactory.OAuthToken(OAuthParameters parameters,
                                             OAuthSigner signer)

  Create a new `GoogleAuthTokenFactory.OAuthToken` object. Store the `OAuthParameters` and `OAuthSigner` to use when generating the header. The following OAuth parameters are required:
  - oauth_consumer_key
  - oauth_token

  Parameters:
    `parameters` - the required OAuth parameters
    `signer` - the `OAuthSigner` object to use when to generate the OAuth signature.

Method Detail

### getAuthorizationHeader

    public java.lang.String getAuthorizationHeader(java.net.URL requestUrl,
                                                   java.lang.String requestMethod)

  Generates the OAuth authorization header using the user's OAuth parameters, the request url and the request method.

  Specified by:
    `getAuthorizationHeader` in interface `HttpAuthToken`
  Parameters:
    `requestUrl` - the URL being requested
    `requestMethod` - the HTTP method of the request
  Returns:
    the authorization header to be used for the request