Class IdentityPoolCredentialSource (1.35.0)

public class IdentityPoolCredentialSource extends ExternalAccountCredentials.CredentialSource

The IdentityPool credential source. Dictates the retrieval method of the external credential, which can either be through a metadata server or a local file.

Inheritance

java.lang.Object > com.google.auth.oauth2.ExternalAccountCredentials.CredentialSource > IdentityPoolCredentialSource

Constructors

IdentityPoolCredentialSource(Map<String,Object> credentialSourceMap)

public IdentityPoolCredentialSource(Map<String,Object> credentialSourceMap)

The source of the 3P credential.

If this is a file based 3P credential, the credentials file can be retrieved using the file key.

If this is URL-based 3p credential, the metadata server URL can be retrieved using the url key.

The third party credential can be provided in different formats, such as text or JSON. The format can be specified using the format header, which returns a map with keys type and subject_token_field_name. If the type is json, the subject_token_field_name must be provided. If no format is provided, we expect the token to be in the raw text format.

Optional headers can be present, and should be keyed by headers.

Parameter
Name Description
credentialSourceMap Map<String,Object>

Methods

getCertificateConfig()

public IdentityPoolCredentialSource.CertificateConfig getCertificateConfig()

Gets the configuration for X.509-based workload credentials (mTLS), if configured.

Returns
Type Description
IdentityPoolCredentialSource.CertificateConfig

The CertificateConfig object, or null if not configured for certificate-based credentials.

getCredentialLocation()

public String getCredentialLocation()

Gets the location of the credential source. This could be a file path or a URL, depending on the IdentityPoolCredentialSourceType.

Returns
Type Description
String

The location of the credential source.

setCredentialLocation(String credentialLocation)

public void setCredentialLocation(String credentialLocation)

Sets the location of the credential source. This method should be used to update the credential location.

Parameter
Name Description
credentialLocation String

The new location of the credential source.