public abstract static class ExternalAccountCredentials.Builder extends GoogleCredentials.Builder
| Modifier and Type | Field and Description |
|---|---|
protected String |
audience |
protected String |
clientId |
protected String |
clientSecret |
protected com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource |
credentialSource |
protected com.google.auth.oauth2.EnvironmentProvider |
environmentProvider |
protected com.google.auth.oauth2.ExternalAccountMetricsHandler |
metricsHandler |
protected Collection<String> |
scopes |
protected com.google.auth.oauth2.ExternalAccountCredentials.ServiceAccountImpersonationOptions |
serviceAccountImpersonationOptions |
protected String |
serviceAccountImpersonationUrl |
protected String |
subjectTokenType |
protected String |
tokenInfoUrl |
protected String |
tokenUrl |
protected HttpTransportFactory |
transportFactory |
protected String |
universeDomain
Deprecated.
|
protected String |
workforcePoolUserProject |
quotaProjectId| Modifier | Constructor and Description |
|---|---|
protected |
Builder() |
protected |
Builder(ExternalAccountCredentials credentials) |
| Modifier and Type | Method and Description |
|---|---|
abstract ExternalAccountCredentials |
build() |
ExternalAccountCredentials.Builder |
setAudience(String audience)
Sets the Security Token Service audience, which is usually the fully specified resource name
of the workload/workforce pool provider.
|
ExternalAccountCredentials.Builder |
setClientId(String clientId)
Sets the optional client ID of the service account from the console.
|
ExternalAccountCredentials.Builder |
setClientSecret(String clientSecret)
Sets the optional client secret of the service account from the console.
|
ExternalAccountCredentials.Builder |
setCredentialSource(com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource credentialSource)
Sets the external credential source.
|
ExternalAccountCredentials.Builder |
setHttpTransportFactory(HttpTransportFactory transportFactory)
Sets the HTTP transport factory, creates the transport used to get access tokens.
|
ExternalAccountCredentials.Builder |
setQuotaProjectId(String quotaProjectId)
Sets the optional project used for quota and billing purposes.
|
ExternalAccountCredentials.Builder |
setScopes(Collection<String> scopes)
Sets the optional scopes to request during the authorization grant.
|
ExternalAccountCredentials.Builder |
setServiceAccountImpersonationOptions(Map<String,Object> optionsMap)
Sets the optional service account impersonation options.
|
ExternalAccountCredentials.Builder |
setServiceAccountImpersonationUrl(String serviceAccountImpersonationUrl)
Sets the optional URL used for service account impersonation, which is required for some
APIs.
|
ExternalAccountCredentials.Builder |
setSubjectTokenType(String subjectTokenType)
Sets the Security Token Service subject token type based on the OAuth 2.0 token exchange
spec.
|
ExternalAccountCredentials.Builder |
setTokenInfoUrl(String tokenInfoUrl)
Sets the optional endpoint used to retrieve account related information.
|
ExternalAccountCredentials.Builder |
setTokenUrl(String tokenUrl)
Sets the Security Token Service token exchange endpoint.
|
ExternalAccountCredentials.Builder |
setUniverseDomain(String universeDomain)
Sets the optional universe domain.
|
ExternalAccountCredentials.Builder |
setWorkforcePoolUserProject(String workforcePoolUserProject)
Sets the optional workforce pool user project number when the credential corresponds to a
workforce pool and not a workload identity pool.
|
getQuotaProjectId, getUniverseDomain, setAccessTokengetAccessToken, getExpirationMargin, getRefreshMargin, setExpirationMargin, setRefreshMarginprotected String audience
protected String subjectTokenType
protected String tokenUrl
protected String tokenInfoUrl
protected com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource credentialSource
protected com.google.auth.oauth2.EnvironmentProvider environmentProvider
protected HttpTransportFactory transportFactory
@Nullable protected Collection<String> scopes
@Nullable protected com.google.auth.oauth2.ExternalAccountCredentials.ServiceAccountImpersonationOptions serviceAccountImpersonationOptions
@Nullable @Deprecated protected String universeDomain
@Nullable protected com.google.auth.oauth2.ExternalAccountMetricsHandler metricsHandler
protected Builder()
protected Builder(ExternalAccountCredentials credentials)
@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)
transportFactory - the HttpTransportFactory to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setAudience(String audience)
audience - the Security Token Service audience to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setSubjectTokenType(String subjectTokenType)
subjectTokenType - the Security Token Service subject token type to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setTokenUrl(String tokenUrl)
tokenUrl - the Security Token Service token exchange url to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setCredentialSource(com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource credentialSource)
credentialSource - the CredentialSource to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setServiceAccountImpersonationUrl(String serviceAccountImpersonationUrl)
serviceAccountImpersonationUrl - the service account impersonation url to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setTokenInfoUrl(String tokenInfoUrl)
tokenInfoUrl - the token info url to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setQuotaProjectId(String quotaProjectId)
setQuotaProjectId in class GoogleCredentials.BuilderquotaProjectId - the quota and billing project id to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setClientId(String clientId)
clientId - the service account client id to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setClientSecret(String clientSecret)
clientSecret - the service account client secret to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setScopes(Collection<String> scopes)
scopes - the request scopes to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setWorkforcePoolUserProject(String workforcePoolUserProject)
workforcePoolUserProject - the workforce pool user project number to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setServiceAccountImpersonationOptions(Map<String,Object> optionsMap)
optionsMap - the service account impersonation options to setBuilder object@CanIgnoreReturnValue public ExternalAccountCredentials.Builder setUniverseDomain(String universeDomain)
setUniverseDomain in class GoogleCredentials.BuilderuniverseDomain - the universe domain to setBuilder objectpublic abstract ExternalAccountCredentials build()
build in class GoogleCredentials.BuilderCopyright © 2024 Google. All rights reserved.