com.google.api.client.googleapis.auth.oauth
Class GoogleOAuthDomainWideDelegation

java.lang.Object
  extended by com.google.api.client.googleapis.auth.oauth.GoogleOAuthDomainWideDelegation
All Implemented Interfaces:
com.google.api.client.http.HttpExecuteInterceptor, com.google.api.client.http.HttpRequestInitializer

public final class GoogleOAuthDomainWideDelegation
extends Object
implements com.google.api.client.http.HttpExecuteInterceptor, com.google.api.client.http.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

Nested Class Summary
static class GoogleOAuthDomainWideDelegation.Url
          Generic URL that extends GoogleUrl and also provides the GoogleOAuthDomainWideDelegation.Url.requestorId parameter.
 
Field Summary
 com.google.api.client.auth.oauth.OAuthParameters parameters
          OAuth parameters.
 String requestorId
          Email address of the user whose data you are trying to access.
 
Constructor Summary
GoogleOAuthDomainWideDelegation()
           
 
Method Summary
 void initialize(com.google.api.client.http.HttpRequest request)
           
 void intercept(com.google.api.client.http.HttpRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestorId

public String requestorId
Email address of the user whose data you are trying to access.


parameters

public com.google.api.client.auth.oauth.OAuthParameters parameters
OAuth parameters.

Since:
1.4
Constructor Detail

GoogleOAuthDomainWideDelegation

public GoogleOAuthDomainWideDelegation()
Method Detail

initialize

public void initialize(com.google.api.client.http.HttpRequest request)
Specified by:
initialize in interface com.google.api.client.http.HttpRequestInitializer

intercept

public void intercept(com.google.api.client.http.HttpRequest request)
               throws IOException
Specified by:
intercept in interface com.google.api.client.http.HttpExecuteInterceptor
Throws:
IOException


Copyright © 2010-2011 Google. All Rights Reserved.