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 of "online".
 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 of "auto".
 GoogleAuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
           
 GoogleAuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
           
 GoogleAuthorizationCodeFlow.Builder setScopes(Iterable<String> scopes)
           
 GoogleAuthorizationCodeFlow.Builder setScopes(String... scopes)
           
 
Methods inherited from class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
getAuthorizationServerEncodedUrl, getClientAuthentication, getClientId, 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

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 of "auto".

By default this has the value "force".

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 of "online".

By default this has the value "offline".

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.