public class ExternalAccountAuthorizedUserCredentials extends GoogleCredentials
Obtaining the initial access and refresh token can be done through the Google Cloud CLI.
Example credentials file:
{
"type": "external_account_authorized_user",
"audience": "//iam.googleapis.com/locations/global/workforcePools/$WORKFORCE_POOL_ID/providers/$PROVIDER_ID",
"refresh_token": "refreshToken",
"token_url": "https://sts.googleapis.com/v1/oauthtoken",
"token_info_url": "https://sts.googleapis.com/v1/introspect",
"client_id": "clientId",
"client_secret": "clientSecret"
}
| Modifier and Type | Class and Description |
|---|---|
static class |
ExternalAccountAuthorizedUserCredentials.Builder
Builder for
ExternalAccountAuthorizedUserCredentials. |
OAuth2Credentials.CredentialsChangedListenerquotaProjectId| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static ExternalAccountAuthorizedUserCredentials |
fromStream(InputStream credentialsStream)
Returns external account authorized user credentials defined by a JSON file stream.
|
static ExternalAccountAuthorizedUserCredentials |
fromStream(InputStream credentialsStream,
HttpTransportFactory transportFactory)
Returns external account authorized user credentials defined by a JSON file stream.
|
String |
getAudience() |
String |
getClientId() |
String |
getClientSecret() |
String |
getRefreshToken() |
String |
getRevokeUrl() |
String |
getTokenInfoUrl() |
String |
getTokenUrl() |
int |
hashCode() |
static ExternalAccountAuthorizedUserCredentials.Builder |
newBuilder() |
AccessToken |
refreshAccessToken()
Method to refresh the access token according to the specific type of credentials.
|
ExternalAccountAuthorizedUserCredentials.Builder |
toBuilder() |
String |
toString() |
create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectIdaddChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerblockingGetToCallback, getRequestMetadatapublic static ExternalAccountAuthorizedUserCredentials fromStream(InputStream credentialsStream) throws IOException
credentialsStream - the stream with the credential definitionIOException - if the credential cannot be created from the streampublic static ExternalAccountAuthorizedUserCredentials fromStream(InputStream credentialsStream, HttpTransportFactory transportFactory) throws IOException
credentialsStream - the stream with the credential definitiontransportFactory - the HTTP transport factory used to create the transport to get access
tokensIOException - if the credential cannot be created from the streampublic AccessToken refreshAccessToken() throws IOException
OAuth2CredentialsThrows IllegalStateException if not overridden since direct use of OAuth2Credentials is only for temporary or non-refreshing access tokens.
refreshAccessToken in class OAuth2CredentialsIOExceptionpublic static ExternalAccountAuthorizedUserCredentials.Builder newBuilder()
public int hashCode()
hashCode in class OAuth2Credentialspublic String toString()
toString in class OAuth2Credentialspublic boolean equals(Object obj)
equals in class OAuth2Credentialspublic ExternalAccountAuthorizedUserCredentials.Builder toBuilder()
toBuilder in class GoogleCredentialsCopyright © 2023 Google. All rights reserved.