com.google.api.client.googleapis.auth.oauth2
Class GoogleAuthorizationCodeFlow.Builder

java.lang.Object
  extended by com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
      extended by com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow.Builder
Enclosing class:
GoogleAuthorizationCodeFlow

public static class GoogleAuthorizationCodeFlow.Builder
extends AuthorizationCodeFlow.Builder

Google authorization code flow builder.

Implementation is not thread-safe.


Constructor Summary
GoogleAuthorizationCodeFlow.Builder(HttpTransport transport, JsonFactory jsonFactory, GoogleClientSecrets clientSecrets, Iterable<String> scopes)
           
GoogleAuthorizationCodeFlow.Builder(HttpTransport transport, JsonFactory jsonFactory, String clientId, String clientSecret, Iterable<String> scopes)
           
 
Method Summary
 GoogleAuthorizationCodeFlow build()
           
 String getAccessType()
          Returns the access type ("online" to request online access or "offline" to request offline access) or null for the default behavior of "online".
 String getApprovalPrompt()
          Returns the approval prompt behavior ("auto" to request auto-approval or "force" to force the approval UI to show) or null for the default behavior of "auto".
 GoogleAuthorizationCodeFlow.Builder setAccessType(String accessType)
          Sets the access type ("online" to request online access or "offline" to request offline access) or null for the default behavior ("online" for web applications and "offline" for installed applications).
 GoogleAuthorizationCodeFlow.Builder setApprovalPrompt(String approvalPrompt)
          Sets the approval prompt behavior ("auto" to request auto-approval or "force" to force the approval UI to show) or null for the default behavior ("auto" for web applications and "force" for installed applications).
 GoogleAuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
           
 GoogleAuthorizationCodeFlow.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
           
 GoogleAuthorizationCodeFlow.Builder setClientId(String clientId)
           
 GoogleAuthorizationCodeFlow.Builder setClock(Clock clock)
           
 GoogleAuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
           
 GoogleAuthorizationCodeFlow.Builder setJsonFactory(JsonFactory jsonFactory)
           
 GoogleAuthorizationCodeFlow.Builder setMethod(Credential.AccessMethod method)
           
 GoogleAuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
           
 GoogleAuthorizationCodeFlow.Builder setScopes(Iterable<String> scopes)
           
 GoogleAuthorizationCodeFlow.Builder setScopes(String... scopes)
           
 GoogleAuthorizationCodeFlow.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
           
 GoogleAuthorizationCodeFlow.Builder setTransport(HttpTransport transport)
           
 
Methods inherited from class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
getAuthorizationServerEncodedUrl, getClientAuthentication, getClientId, getClock, getCredentialStore, getJsonFactory, getMethod, getRequestInitializer, getScopes, getTokenServerUrl, getTransport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleAuthorizationCodeFlow.Builder

public GoogleAuthorizationCodeFlow.Builder(HttpTransport transport,
                                           JsonFactory jsonFactory,
                                           String clientId,
                                           String clientSecret,
                                           Iterable<String> scopes)
Parameters:
transport - HTTP transport
jsonFactory - JSON factory
clientId - client identifier
clientSecret - client secret
scopes - list of scopes to be joined by a space separator (or a single value containing multiple space-separated scopes)

GoogleAuthorizationCodeFlow.Builder

public GoogleAuthorizationCodeFlow.Builder(HttpTransport transport,
                                           JsonFactory jsonFactory,
                                           GoogleClientSecrets clientSecrets,
                                           Iterable<String> scopes)
Parameters:
transport - HTTP transport
jsonFactory - JSON factory
clientSecrets - Google client secrets
scopes - list of scopes to be joined by a space separator (or a single value containing multiple space-separated scopes)
Method Detail

build

public GoogleAuthorizationCodeFlow build()
Overrides:
build in class AuthorizationCodeFlow.Builder

setCredentialStore

public GoogleAuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
Overrides:
setCredentialStore in class AuthorizationCodeFlow.Builder

setRequestInitializer

public GoogleAuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
Overrides:
setRequestInitializer in class AuthorizationCodeFlow.Builder

setScopes

public GoogleAuthorizationCodeFlow.Builder setScopes(Iterable<String> scopes)
Overrides:
setScopes in class AuthorizationCodeFlow.Builder

setScopes

public GoogleAuthorizationCodeFlow.Builder setScopes(String... scopes)
Overrides:
setScopes in class AuthorizationCodeFlow.Builder

setMethod

public GoogleAuthorizationCodeFlow.Builder setMethod(Credential.AccessMethod method)
Overrides:
setMethod in class AuthorizationCodeFlow.Builder
Since:
1.11

setTransport

public GoogleAuthorizationCodeFlow.Builder setTransport(HttpTransport transport)
Overrides:
setTransport in class AuthorizationCodeFlow.Builder
Since:
1.11

setJsonFactory

public GoogleAuthorizationCodeFlow.Builder setJsonFactory(JsonFactory jsonFactory)
Overrides:
setJsonFactory in class AuthorizationCodeFlow.Builder
Since:
1.11

setTokenServerUrl

public GoogleAuthorizationCodeFlow.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
Overrides:
setTokenServerUrl in class AuthorizationCodeFlow.Builder
Since:
1.11

setClientAuthentication

public GoogleAuthorizationCodeFlow.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
Overrides:
setClientAuthentication in class AuthorizationCodeFlow.Builder
Since:
1.11

setClientId

public GoogleAuthorizationCodeFlow.Builder setClientId(String clientId)
Overrides:
setClientId in class AuthorizationCodeFlow.Builder
Since:
1.11

setAuthorizationServerEncodedUrl

public GoogleAuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
Overrides:
setAuthorizationServerEncodedUrl in class AuthorizationCodeFlow.Builder
Since:
1.11

setClock

public GoogleAuthorizationCodeFlow.Builder setClock(Clock clock)
Overrides:
setClock in class AuthorizationCodeFlow.Builder
Since:
1.11

setApprovalPrompt

public GoogleAuthorizationCodeFlow.Builder setApprovalPrompt(String approvalPrompt)
Sets the approval prompt behavior ("auto" to request auto-approval or "force" to force the approval UI to show) or null for the default behavior ("auto" for web applications and "force" for installed applications).

By default this has the value null.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getApprovalPrompt

public final String getApprovalPrompt()
Returns the approval prompt behavior ("auto" to request auto-approval or "force" to force the approval UI to show) or null for the default behavior of "auto".


setAccessType

public GoogleAuthorizationCodeFlow.Builder setAccessType(String accessType)
Sets the access type ("online" to request online access or "offline" to request offline access) or null for the default behavior ("online" for web applications and "offline" for installed applications).

By default this has the value null.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getAccessType

public final String getAccessType()
Returns the access type ("online" to request online access or "offline" to request offline access) or null for the default behavior of "online".



Copyright © 2010-2012 Google. All Rights Reserved.