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.
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 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 parameterssigner
- the OAuthSigner
object to use when to generate the
OAuth signature.
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 requestedrequestMethod
- the HTTP method of the request
- Returns:
- the authorization header to be used for the request