public static class AuthorizationCodeFlow.Builder extends Object
Implementation is not thread-safe.
Constructor and Description |
---|
Builder(Credential.AccessMethod method,
HttpTransport transport,
JsonFactory jsonFactory,
GenericUrl tokenServerUrl,
HttpExecuteInterceptor clientAuthentication,
String clientId,
String authorizationServerEncodedUrl) |
public Builder(Credential.AccessMethod method, HttpTransport transport, JsonFactory jsonFactory, GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, String authorizationServerEncodedUrl)
method
- method of presenting the access token to the resource server (for example
BearerToken.authorizationHeaderAccessMethod()
)transport
- HTTP transportjsonFactory
- JSON factorytokenServerUrl
- token server URLclientAuthentication
- client authentication or null
for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor)
)clientId
- client identifierauthorizationServerEncodedUrl
- authorization server encoded URLpublic AuthorizationCodeFlow build()
public final Credential.AccessMethod getMethod()
BearerToken.authorizationHeaderAccessMethod()
).public AuthorizationCodeFlow.Builder setMethod(Credential.AccessMethod method)
BearerToken.authorizationHeaderAccessMethod()
).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final HttpTransport getTransport()
public AuthorizationCodeFlow.Builder setTransport(HttpTransport transport)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final JsonFactory getJsonFactory()
public AuthorizationCodeFlow.Builder setJsonFactory(JsonFactory jsonFactory)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final GenericUrl getTokenServerUrl()
public AuthorizationCodeFlow.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final HttpExecuteInterceptor getClientAuthentication()
null
for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor)
).public AuthorizationCodeFlow.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
null
for none (see
TokenRequest.setClientAuthentication(HttpExecuteInterceptor)
).
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getClientId()
public AuthorizationCodeFlow.Builder setClientId(String clientId)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final String getAuthorizationServerEncodedUrl()
public AuthorizationCodeFlow.Builder setAuthorizationServerEncodedUrl(String authorizationServerEncodedUrl)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta @Deprecated public final CredentialStore getCredentialStore()
getCredentialDataStore()
instead.@Beta public final DataStore<StoredCredential> getCredentialDataStore()
public final Clock getClock()
Clock.SYSTEM
when system default
is used.public AuthorizationCodeFlow.Builder setClock(Clock clock)
The default value for this parameter is Clock.SYSTEM
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta @Deprecated public AuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
setDataStoreFactory(DataStoreFactory)
or
setCredentialDataStore(DataStore)
instead.Beta
null
for none.
Warning: not compatible with setDataStoreFactory(com.google.api.client.util.store.DataStoreFactory)
or setCredentialDataStore(com.google.api.client.util.store.DataStore<com.google.api.client.auth.oauth2.StoredCredential>)
,
and if either of those is called before this method is called, this method will throw an
IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta public AuthorizationCodeFlow.Builder setDataStoreFactory(DataStoreFactory dataStoreFactory) throws IOException
Beta
null
for none.
Warning: not compatible with setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore)
, and if it is called before this
method is called, this method will throw an IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
IOException
@Beta public AuthorizationCodeFlow.Builder setCredentialDataStore(DataStore<StoredCredential> credentialDataStore)
Beta
null
for none.
Warning: not compatible with setCredentialStore(com.google.api.client.auth.oauth2.CredentialStore)
, and if it is called before this
method is called, this method will throw an IllegalArgumentException
.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final HttpRequestInitializer getRequestInitializer()
null
for none.public AuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public AuthorizationCodeFlow.Builder setScopes(Collection<String> scopes)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
scopes
- collection of scopespublic final Collection<String> getScopes()
public AuthorizationCodeFlow.Builder setCredentialCreatedListener(AuthorizationCodeFlow.CredentialCreatedListener credentialCreatedListener)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public AuthorizationCodeFlow.Builder addRefreshListener(CredentialRefreshListener refreshListener)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
refreshListener
- refresh listenerpublic final Collection<CredentialRefreshListener> getRefreshListeners()
public AuthorizationCodeFlow.Builder setRefreshListeners(Collection<CredentialRefreshListener> refreshListeners)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final AuthorizationCodeFlow.CredentialCreatedListener getCredentialCreatedListener()
null
for none.Copyright © 2011–2019 Google. All rights reserved.