public class IdentityPoolCredentials extends ExternalAccountCredentialsUrl-sourced, file-sourced, or user provided supplier method-sourced external account credentials.
By default, attempts to exchange the external credential for a GCP access token.
Note: Actor token extraction from credential configuration files is currently restricted to file-based JSON credential sources. When configuring certificate-bound OAuth 2.0 tokens, ensure your transport layer and endpoints are configured for mTLS in tandem.
Inheritance
java.lang.Object > Credentials > OAuth2Credentials > GoogleCredentials > ExternalAccountCredentials > IdentityPoolCredentialsStatic Methods
newBuilder()
public static IdentityPoolCredentials.Builder newBuilder()| Returns | |
|---|---|
| Type | Description |
IdentityPoolCredentials.Builder |
|
newBuilder(IdentityPoolCredentials identityPoolCredentials)
public static IdentityPoolCredentials.Builder newBuilder(IdentityPoolCredentials identityPoolCredentials)| Parameter | |
|---|---|
| Name | Description |
identityPoolCredentials |
IdentityPoolCredentials |
| Returns | |
|---|---|
| Type | Description |
IdentityPoolCredentials.Builder |
|
Methods
createScoped(Collection<String> newScopes)
public IdentityPoolCredentials createScoped(Collection<String> newScopes)Clones the IdentityPoolCredentials with the specified scopes.
| Parameter | |
|---|---|
| Name | Description |
newScopes |
Collection<String> |
| Returns | |
|---|---|
| Type | Description |
IdentityPoolCredentials |
|
refreshAccessToken()
public AccessToken refreshAccessToken()Method to refresh the access token according to the specific type of credentials.
Throws IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
| Returns | |
|---|---|
| Type | Description |
AccessToken |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
retrieveSubjectToken()
public String retrieveSubjectToken()Retrieves the external subject token to be exchanged for a Google Cloud access token.
Must be implemented by subclasses as the retrieval method is dependent on the credential source.
| Returns | |
|---|---|
| Type | Description |
String |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
toBuilder()
public IdentityPoolCredentials.Builder toBuilder()| Returns | |
|---|---|
| Type | Description |
IdentityPoolCredentials.Builder |
|