public static class GoogleCredential.Builder
extends com.google.api.client.auth.oauth2.Credential.Builder
Implementation is not thread-safe.
Constructor and Description |
---|
GoogleCredential.Builder() |
Modifier and Type | Method and Description |
---|---|
GoogleCredential.Builder |
addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener) |
GoogleCredential |
build() |
java.lang.String |
getServiceAccountId()
Returns the service account ID (typically an e-mail address) or
null for none. |
java.security.PrivateKey |
getServiceAccountPrivateKey()
Returns the private key to use with the service account flow or
null for none. |
java.lang.String |
getServiceAccountPrivateKeyId()
Beta Returns the id of the private key to use with the service account flow or null
for none. |
java.lang.String |
getServiceAccountProjectId()
Returns the service account Project ID or
null for none. |
java.util.Collection<java.lang.String> |
getServiceAccountScopes()
Returns a collection of OAuth scopes to use with the service account flow or
null
for none. |
java.lang.String |
getServiceAccountUser()
Returns the email address of the user the application is trying to impersonate in the service
account flow or
null for none. |
GoogleCredential.Builder |
setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication) |
GoogleCredential.Builder |
setClientSecrets(GoogleClientSecrets clientSecrets)
Sets the client secrets.
|
GoogleCredential.Builder |
setClientSecrets(java.lang.String clientId,
java.lang.String clientSecret)
Sets the client identifier and secret.
|
GoogleCredential.Builder |
setClock(com.google.api.client.util.Clock clock) |
GoogleCredential.Builder |
setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory) |
GoogleCredential.Builder |
setRefreshListeners(java.util.Collection<com.google.api.client.auth.oauth2.CredentialRefreshListener> refreshListeners) |
GoogleCredential.Builder |
setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) |
GoogleCredential.Builder |
setServiceAccountId(java.lang.String serviceAccountId)
Sets the service account ID (typically an e-mail address) or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKey(java.security.PrivateKey serviceAccountPrivateKey)
Sets the private key to use with the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyFromP12File(java.io.File p12File)
Sets the private key to use with the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyFromPemFile(java.io.File pemFile)
Beta Sets the private key to use with the service account flow or null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyId(java.lang.String serviceAccountPrivateKeyId)
Beta Sets the id of the private key to use with the service account flow or null for
none. |
GoogleCredential.Builder |
setServiceAccountProjectId(java.lang.String serviceAccountProjectId)
Sets the service account Project ID or
null for none. |
GoogleCredential.Builder |
setServiceAccountScopes(java.util.Collection<java.lang.String> serviceAccountScopes)
Sets the space-separated OAuth scopes to use with the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountUser(java.lang.String serviceAccountUser)
Sets the email address of the user the application is trying to impersonate in the service
account flow or
null for none. |
GoogleCredential.Builder |
setTokenServerEncodedUrl(java.lang.String tokenServerEncodedUrl) |
GoogleCredential.Builder |
setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl) |
GoogleCredential.Builder |
setTransport(com.google.api.client.http.HttpTransport transport) |
public GoogleCredential build()
build
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setTransport(com.google.api.client.http.HttpTransport transport)
setTransport
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setJsonFactory(com.google.api.client.json.JsonFactory jsonFactory)
setJsonFactory
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setClock(com.google.api.client.util.Clock clock)
setClock
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setClientSecrets(java.lang.String clientId, java.lang.String clientSecret)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setClientSecrets(GoogleClientSecrets clientSecrets)
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final java.lang.String getServiceAccountId()
null
for none.public GoogleCredential.Builder setServiceAccountId(java.lang.String serviceAccountId)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final java.lang.String getServiceAccountProjectId()
null
for none.public GoogleCredential.Builder setServiceAccountProjectId(java.lang.String serviceAccountProjectId)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public final java.util.Collection<java.lang.String> getServiceAccountScopes()
null
for none.public GoogleCredential.Builder setServiceAccountScopes(java.util.Collection<java.lang.String> serviceAccountScopes)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
serviceAccountScopes
- collection of scopes to be joined by a space separator (or a
single value containing multiple space-separated scopes)public final java.security.PrivateKey getServiceAccountPrivateKey()
null
for none.public GoogleCredential.Builder setServiceAccountPrivateKey(java.security.PrivateKey serviceAccountPrivateKey)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
@Beta public final java.lang.String getServiceAccountPrivateKeyId()
Beta
null
for none.@Beta public GoogleCredential.Builder setServiceAccountPrivateKeyId(java.lang.String serviceAccountPrivateKeyId)
Beta
null
for
none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setServiceAccountPrivateKeyFromP12File(java.io.File p12File) throws java.security.GeneralSecurityException, java.io.IOException
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
p12File
- input stream to the p12 file (closed at the end of this method in a finally
block)java.security.GeneralSecurityException
java.io.IOException
@Beta public GoogleCredential.Builder setServiceAccountPrivateKeyFromPemFile(java.io.File pemFile) throws java.security.GeneralSecurityException, java.io.IOException
Beta
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
pemFile
- input stream to the PEM file (closed at the end of this method in a finally
block)java.security.GeneralSecurityException
java.io.IOException
public final java.lang.String getServiceAccountUser()
null
for none.public GoogleCredential.Builder setServiceAccountUser(java.lang.String serviceAccountUser)
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
public GoogleCredential.Builder setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer)
setRequestInitializer
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder addRefreshListener(com.google.api.client.auth.oauth2.CredentialRefreshListener refreshListener)
addRefreshListener
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setRefreshListeners(java.util.Collection<com.google.api.client.auth.oauth2.CredentialRefreshListener> refreshListeners)
setRefreshListeners
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setTokenServerUrl(com.google.api.client.http.GenericUrl tokenServerUrl)
setTokenServerUrl
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setTokenServerEncodedUrl(java.lang.String tokenServerEncodedUrl)
setTokenServerEncodedUrl
in class com.google.api.client.auth.oauth2.Credential.Builder
public GoogleCredential.Builder setClientAuthentication(com.google.api.client.http.HttpExecuteInterceptor clientAuthentication)
setClientAuthentication
in class com.google.api.client.auth.oauth2.Credential.Builder
Copyright © 2010-2018 Google. All Rights Reserved.