com.google.api.client.googleapis.auth.oauth
Class GoogleOAuthDomainWideDelegation
java.lang.Object
com.google.api.client.googleapis.auth.oauth.GoogleOAuthDomainWideDelegation
- All Implemented Interfaces:
- HttpExecuteInterceptor, HttpRequestInitializer
public final class GoogleOAuthDomainWideDelegation
- extends Object
- implements HttpExecuteInterceptor, HttpRequestInitializer
Google's OAuth domain-wide delegation requires an e-mail address of the user whose data you are
trying to access via requestorId on every HTTP request.
Sample usage, taking advantage that this class implements HttpRequestInitializer:
public static HttpRequestFactory createRequestFactory(HttpTransport transport) {
GoogleOAuthDomainWideDelegation initializer = new GoogleOAuthDomainWideDelegation();
initializer.requestorId = "...";
OAuthParameters parameters = new OAuthParameters();
// parameters...
initializer.parameters = parameters;
return transport.createRequestFactory(initializer);
}
If you have a custom request initializer, take a look at the sample usage for
HttpExecuteInterceptor, which this class also implements.
- Since:
- 1.0
- Author:
- Yaniv Inbar
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
requestorId
public String requestorId
- Email address of the user whose data you are trying to access.
parameters
public OAuthParameters parameters
- OAuth parameters.
- Since:
- 1.4
GoogleOAuthDomainWideDelegation
public GoogleOAuthDomainWideDelegation()
initialize
public void initialize(HttpRequest request)
- Specified by:
initialize in interface HttpRequestInitializer
intercept
public void intercept(HttpRequest request)
throws IOException
- Specified by:
intercept in interface HttpExecuteInterceptor
- Throws:
IOException
Copyright © 2010-2011 Google. All Rights Reserved.