# Class PluggableAuthCredentials.Builder (1.46.0)

1.46.0 (latest) 1.43.0 1.42.1 1.41.0 1.40.0 1.39.1 1.38.0 1.37.1 1.36.0 1.35.0 1.34.0 1.33.1 1.32.1 1.31.0 1.30.1 1.29.1-SNAPSHOT 1.28.0 1.27.0 1.26.0 1.25.0 1.24.1 1.20.0 1.19.0 1.18.0 1.7.0 1.6.1 1.4.0 1.3.0

    public static class PluggableAuthCredentials.Builder extends ExternalAccountCredentials.Builder

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [OAuth2Credentials.Builder](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder) \> [GoogleCredentials.Builder](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.GoogleCredentials.Builder) \> [ExternalAccountCredentials.Builder](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder) \> PluggableAuthCredentials.Builder

## Inherited Members

[ExternalAccountCredentials.Builder.build()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_build__) [ExternalAccountCredentials.Builder.setAudience(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setAudience_java_lang_String_) [ExternalAccountCredentials.Builder.setClientId(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setClientId_java_lang_String_) [ExternalAccountCredentials.Builder.setClientSecret(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setClientSecret_java_lang_String_) [ExternalAccountCredentials.Builder.setConnectTimeout(int)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setConnectTimeout_int_) [ExternalAccountCredentials.Builder.setCredentialSource(ExternalAccountCredentials.CredentialSource)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setCredentialSource_com_google_auth_oauth2_ExternalAccountCredentials_CredentialSource_) [ExternalAccountCredentials.Builder.setHttpTransportFactory(HttpTransportFactory)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setHttpTransportFactory_com_google_auth_http_HttpTransportFactory_) [ExternalAccountCredentials.Builder.setQuotaProjectId(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setQuotaProjectId_java_lang_String_) [ExternalAccountCredentials.Builder.setReadTimeout(int)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setReadTimeout_int_) [ExternalAccountCredentials.Builder.setScopes(Collection\<String\>)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setScopes_java_util_Collection_java_lang_String__) [ExternalAccountCredentials.Builder.setServiceAccountImpersonationOptions(Map\<String,Object\>)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setServiceAccountImpersonationOptions_java_util_Map_java_lang_String_java_lang_Object__) [ExternalAccountCredentials.Builder.setServiceAccountImpersonationUrl(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setServiceAccountImpersonationUrl_java_lang_String_) [ExternalAccountCredentials.Builder.setSubjectTokenType(ExternalAccountCredentials.SubjectTokenTypes)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setSubjectTokenType_com_google_auth_oauth2_ExternalAccountCredentials_SubjectTokenTypes_) [ExternalAccountCredentials.Builder.setSubjectTokenType(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setSubjectTokenType_java_lang_String_) [ExternalAccountCredentials.Builder.setTokenInfoUrl(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setTokenInfoUrl_java_lang_String_) [ExternalAccountCredentials.Builder.setTokenUrl(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setTokenUrl_java_lang_String_) [ExternalAccountCredentials.Builder.setUniverseDomain(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setUniverseDomain_java_lang_String_) [ExternalAccountCredentials.Builder.setWorkforcePoolUserProject(String)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setWorkforcePoolUserProject_java_lang_String_) [GoogleCredentials.Builder.getQuotaProjectId()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.GoogleCredentials.Builder#com_google_auth_oauth2_GoogleCredentials_Builder_getQuotaProjectId__) [GoogleCredentials.Builder.getUniverseDomain()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.GoogleCredentials.Builder#com_google_auth_oauth2_GoogleCredentials_Builder_getUniverseDomain__) [GoogleCredentials.Builder.setAccessToken(AccessToken)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.GoogleCredentials.Builder#com_google_auth_oauth2_GoogleCredentials_Builder_setAccessToken_com_google_auth_oauth2_AccessToken_) [OAuth2Credentials.Builder.getAccessToken()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder#com_google_auth_oauth2_OAuth2Credentials_Builder_getAccessToken__) [OAuth2Credentials.Builder.getExpirationMargin()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder#com_google_auth_oauth2_OAuth2Credentials_Builder_getExpirationMargin__) [OAuth2Credentials.Builder.getRefreshMargin()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder#com_google_auth_oauth2_OAuth2Credentials_Builder_getRefreshMargin__) [OAuth2Credentials.Builder.setExpirationMargin(Duration)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder#com_google_auth_oauth2_OAuth2Credentials_Builder_setExpirationMargin_java_time_Duration_) [OAuth2Credentials.Builder.setRefreshMargin(Duration)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials.Builder#com_google_auth_oauth2_OAuth2Credentials_Builder_setRefreshMargin_java_time_Duration_) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Methods

### build()

    public PluggableAuthCredentials build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials` |   |

**Overrides** [ExternalAccountCredentials.Builder.build()](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_build__)

### setAudience(String audience)

    public PluggableAuthCredentials.Builder setAudience(String audience)

Sets the Security Token Service audience, which is usually the fully specified resource name
of the workload/workforce pool provider.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `audience` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setAudience(String audience)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setAudience_java_lang_String_)

### setClientId(String clientId)

    public PluggableAuthCredentials.Builder setClientId(String clientId)

Sets the optional client ID of the service account from the console.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setClientId(String clientId)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setClientId_java_lang_String_)

### setClientSecret(String clientSecret)

    public PluggableAuthCredentials.Builder setClientSecret(String clientSecret)

Sets the optional client secret of the service account from the console.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `clientSecret` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setClientSecret(String clientSecret)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setClientSecret_java_lang_String_)

### setCredentialSource(PluggableAuthCredentialSource credentialSource)

    public PluggableAuthCredentials.Builder setCredentialSource(PluggableAuthCredentialSource credentialSource)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `credentialSource` | `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentialSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

### setExecutableHandler(ExecutableHandler handler)

    public PluggableAuthCredentials.Builder setExecutableHandler(ExecutableHandler handler)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `handler` | `com.google.auth.oauth2.ExecutableHandler` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

### setHttpTransportFactory(HttpTransportFactory transportFactory)

    public PluggableAuthCredentials.Builder setHttpTransportFactory(HttpTransportFactory transportFactory)

Sets the HTTP transport factory, creates the transport used to get access tokens.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `transportFactory` | `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.http.HttpTransportFactory` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setHttpTransportFactory(HttpTransportFactory transportFactory)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setHttpTransportFactory_com_google_auth_http_HttpTransportFactory_)

### setQuotaProjectId(String quotaProjectId)

    public PluggableAuthCredentials.Builder setQuotaProjectId(String quotaProjectId)

Sets the optional project used for quota and billing purposes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `quotaProjectId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setQuotaProjectId(String quotaProjectId)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setQuotaProjectId_java_lang_String_)

### setScopes(Collection\<String\> scopes)

    public PluggableAuthCredentials.Builder setScopes(Collection<String> scopes)

Sets the optional scopes to request during the authorization grant.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `scopes` | `https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setScopes(Collection\<String\> scopes)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setScopes_java_util_Collection_java_lang_String__)

### setServiceAccountImpersonationOptions(Map\<String,Object\> optionsMap)

    public PluggableAuthCredentials.Builder setServiceAccountImpersonationOptions(Map<String,Object> optionsMap)

Sets the optional service account impersonation options.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `optionsMap` | `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setServiceAccountImpersonationOptions(Map\<String,Object\> optionsMap)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setServiceAccountImpersonationOptions_java_util_Map_java_lang_String_java_lang_Object__)

### setServiceAccountImpersonationUrl(String serviceAccountImpersonationUrl)

    public PluggableAuthCredentials.Builder setServiceAccountImpersonationUrl(String serviceAccountImpersonationUrl)

Sets the optional URL used for service account impersonation, which is required for some
APIs. If this URL is not available, the access token from the Security Token Service is used
directly.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `serviceAccountImpersonationUrl` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setServiceAccountImpersonationUrl(String serviceAccountImpersonationUrl)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setServiceAccountImpersonationUrl_java_lang_String_)

### setSubjectTokenType(ExternalAccountCredentials.SubjectTokenTypes subjectTokenType)

    public PluggableAuthCredentials.Builder setSubjectTokenType(ExternalAccountCredentials.SubjectTokenTypes subjectTokenType)

Sets the Security Token Service subject token type based on the OAuth 2.0 token exchange
spec. Indicates the type of the security token in the credential file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `subjectTokenType` | `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.SubjectTokenTypes` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setSubjectTokenType(ExternalAccountCredentials.SubjectTokenTypes subjectTokenType)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setSubjectTokenType_com_google_auth_oauth2_ExternalAccountCredentials_SubjectTokenTypes_)

### setSubjectTokenType(String subjectTokenType)

    public PluggableAuthCredentials.Builder setSubjectTokenType(String subjectTokenType)

Sets the Security Token Service subject token type based on the OAuth 2.0 token exchange
spec. Indicates the type of the security token in the credential file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `subjectTokenType` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setSubjectTokenType(String subjectTokenType)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setSubjectTokenType_java_lang_String_)

### setTokenInfoUrl(String tokenInfoUrl)

    public PluggableAuthCredentials.Builder setTokenInfoUrl(String tokenInfoUrl)

Sets the optional endpoint used to retrieve account related information. Required for gCloud
session account identification.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tokenInfoUrl` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setTokenInfoUrl(String tokenInfoUrl)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setTokenInfoUrl_java_lang_String_)

### setTokenUrl(String tokenUrl)

    public PluggableAuthCredentials.Builder setTokenUrl(String tokenUrl)

Sets the Security Token Service token exchange endpoint.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `tokenUrl` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setTokenUrl(String tokenUrl)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setTokenUrl_java_lang_String_)

### setUniverseDomain(String universeDomain)

    public PluggableAuthCredentials.Builder setUniverseDomain(String universeDomain)

Sets the optional universe domain.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `universeDomain` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setUniverseDomain(String universeDomain)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setUniverseDomain_java_lang_String_)

### setWorkforcePoolUserProject(String workforcePoolUserProject)

    public PluggableAuthCredentials.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. The underlying principal must still have
serviceusage.services.use IAM permission to use the project for billing/quota.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `workforcePoolUserProject` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.PluggableAuthCredentials.Builder` |   |

**Overrides** [ExternalAccountCredentials.Builder.setWorkforcePoolUserProject(String workforcePoolUserProject)](https://docs.cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.ExternalAccountCredentials.Builder#com_google_auth_oauth2_ExternalAccountCredentials_Builder_setWorkforcePoolUserProject_java_lang_String_)