Class IdentityPoolCredentials (1.20.0)

public class IdentityPoolCredentials extends ExternalAccountCredentials

Url-sourced and file-sourced external account credentials.

By default, attempts to exchange the external credential for a GCP access token.

Static Methods

newBuilder()

public static IdentityPoolCredentials.Builder newBuilder()
Returns
TypeDescription
IdentityPoolCredentials.Builder

newBuilder(IdentityPoolCredentials identityPoolCredentials)

public static IdentityPoolCredentials.Builder newBuilder(IdentityPoolCredentials identityPoolCredentials)
Parameter
NameDescription
identityPoolCredentialsIdentityPoolCredentials
Returns
TypeDescription
IdentityPoolCredentials.Builder

Methods

createScoped(Collection<String> newScopes)

public IdentityPoolCredentials createScoped(Collection<String> newScopes)

Clones the IdentityPoolCredentials with the specified scopes.

Parameter
NameDescription
newScopesCollection<String>
Returns
TypeDescription
IdentityPoolCredentials
Overrides

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
TypeDescription
AccessToken
Overrides
Exceptions
TypeDescription
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
TypeDescription
String
Overrides
Exceptions
TypeDescription
IOException