public static class GoogleAuthorizationCodeFlow.Builder
extends com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
Implementation is not thread-safe.
Constructor and Description |
---|
Builder(com.google.api.client.http.HttpTransport transport,
com.google.api.client.json.JsonFactory jsonFactory,
GoogleClientSecrets clientSecrets,
Collection<String> scopes) |
Builder(com.google.api.client.http.HttpTransport transport,
com.google.api.client.json.JsonFactory jsonFactory,
String clientId,
String clientSecret,
Collection<String> scopes) |
Modifier and Type | Method and Description |
---|---|
GoogleAuthorizationCodeFlow.Builder |
addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener) |
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(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication) |
GoogleAuthorizationCodeFlow.Builder |
setClientId(String clientId) |
GoogleAuthorizationCodeFlow.Builder |
setClock(com.google.api.client.util.Clock clock) |
GoogleAuthorizationCodeFlow.Builder |
setCredentialCreatedListener(com.google.api.client.auth.oauth2.AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener) |
GoogleAuthorizationCodeFlow.Builder |
setCredentialDataStore(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> typedDataStore) |
GoogleAuthorizationCodeFlow.Builder |
setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore credentialStore)
Deprecated.
|
GoogleAuthorizationCodeFlow.Builder |
setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStore) |
GoogleAuthorizationCodeFlow.Builder |
setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory) |
GoogleAuthorizationCodeFlow.Builder |
setMethod(com.google.api.client.auth.oauth2.Credential.AccessMethod method) |
GoogleAuthorizationCodeFlow.Builder |
setRefreshListeners(Collection<com.google.api.client.auth.oauth2.CredentialRefreshListener> refreshListeners) |
GoogleAuthorizationCodeFlow.Builder |
setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) |
GoogleAuthorizationCodeFlow.Builder |
setScopes(Collection<String> scopes) |
GoogleAuthorizationCodeFlow.Builder |
setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl) |
GoogleAuthorizationCodeFlow.Builder |
setTransport(com.google.api.client.http.HttpTransport transport) |
getAuthorizationServerEncodedUrl, getClientAuthentication, getClientId, getClock, getCredentialCreatedListener, getCredentialDataStore, getCredentialStore, getJsonFactory, getMethod, getRefreshListeners, getRequestInitializer, getScopes, getTokenServerUrl, getTransport
public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory, String clientId, String clientSecret, Collection<String> scopes)
transport
- HTTP transportjsonFactory
- JSON factoryclientId
- client identifierclientSecret
- client secretscopes
- collection of scopes to be joined by a space separator (or a single value
containing multiple space-separated scopes)public Builder(com.google.api.client.http.HttpTransport transport, com.google.api.client.json.JsonFactory jsonFactory, GoogleClientSecrets clientSecrets, Collection<String> scopes)
transport
- HTTP transportjsonFactory
- JSON factoryclientSecrets
- Google client secretsscopes
- collection of scopes to be joined by a space separatorpublic GoogleAuthorizationCodeFlow build()
build
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory dataStore) throws IOException
setDataStoreFactory
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
IOException
public GoogleAuthorizationCodeFlow.Builder setCredentialDataStore(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential> typedDataStore)
setCredentialDataStore
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setCredentialCreatedListener(com.google.api.client.auth.oauth2.AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener)
setCredentialCreatedListener
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
@Beta @Deprecated public GoogleAuthorizationCodeFlow.Builder setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore credentialStore)
setCredentialStore
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer)
setRequestInitializer
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setScopes(Collection<String> scopes)
setScopes
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setMethod(com.google.api.client.auth.oauth2.Credential.AccessMethod method)
setMethod
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setTransport(com.google.api.client.http.HttpTransport transport)
setTransport
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
setJsonFactory
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl)
setTokenServerUrl
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication)
setClientAuthentication
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setClientId(String clientId)
setClientId
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
setAuthorizationServerEncodedUrl
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setClock(com.google.api.client.util.Clock clock)
setClock
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener)
addRefreshListener
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setRefreshListeners(Collection<com.google.api.client.auth.oauth2.CredentialRefreshListener> refreshListeners)
setRefreshListeners
in class com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
public GoogleAuthorizationCodeFlow.Builder setApprovalPrompt(String approvalPrompt)
"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.
public final String getApprovalPrompt()
"auto"
to request auto-approval or
"force"
to force the approval UI to show) or null
for the default behavior of
"auto"
.public GoogleAuthorizationCodeFlow.Builder setAccessType(String accessType)
"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.
public final String getAccessType()
"online"
to request online access or "offline"
to
request offline access) or null
for the default behavior of "online"
.Copyright © 2010–2019 Google. All rights reserved.