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() |
String |
getServiceAccountId()
Returns the service account ID (typically an e-mail address) or
null for none. |
PrivateKey |
getServiceAccountPrivateKey()
Returns the private key to use with the the service account flow or
null for none. |
String |
getServiceAccountScopes()
Returns the space-separated OAuth scopes to use with the the service account flow or
null for none. |
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(String clientId,
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(List<com.google.api.client.auth.oauth2.CredentialRefreshListener> refreshListeners) |
GoogleCredential.Builder |
setRequestInitializer(com.google.api.client.http.HttpRequestInitializer requestInitializer) |
GoogleCredential.Builder |
setServiceAccountId(String serviceAccountId)
Sets the service account ID (typically an e-mail address) or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKey(PrivateKey serviceAccountPrivateKey)
Sets the private key to use with the the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyFromP12File(File p12File)
Sets the private key to use with the the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountPrivateKeyFromPemFile(File pemFile)
Sets the private key to use with the the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountScopes(Iterable<String> serviceAccountScopes)
Sets the space-separated OAuth scopes to use with the the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountScopes(String... serviceAccountScopes)
Sets the space-separated OAuth scopes to use with the the service account flow or
null for none. |
GoogleCredential.Builder |
setServiceAccountUser(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(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(String clientId, 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 String getServiceAccountId()
null
for none.public GoogleCredential.Builder setServiceAccountId(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 String getServiceAccountScopes()
null
for none.public GoogleCredential.Builder setServiceAccountScopes(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
- list of scopes to be joined by a space separator (or a single
value containing multiple space-separated scopes)public GoogleCredential.Builder setServiceAccountScopes(Iterable<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
- list of scopes to be joined by a space separator (or a single
value containing multiple space-separated scopes)public final PrivateKey getServiceAccountPrivateKey()
null
for none.public GoogleCredential.Builder setServiceAccountPrivateKey(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.
public GoogleCredential.Builder setServiceAccountPrivateKeyFromP12File(File p12File) throws GeneralSecurityException, 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)GeneralSecurityException
IOException
public GoogleCredential.Builder setServiceAccountPrivateKeyFromPemFile(File pemFile) throws GeneralSecurityException, IOException
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)GeneralSecurityException
IOException
public final String getServiceAccountUser()
null
for none.public GoogleCredential.Builder setServiceAccountUser(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(List<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(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-2013 Google. All Rights Reserved.