Send feedback
Class ExternalAccountAuthorizedUserCredentials (1.24.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 1.24.0 keyboard_arrow_down
public class ExternalAccountAuthorizedUserCredentials extends GoogleCredentials
OAuth2 credentials sourced using external identities through Workforce Identity Federation.
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"
}
Static Methods
public static ExternalAccountAuthorizedUserCredentials fromStream ( InputStream credentialsStream )
Returns external account authorized user credentials defined by a JSON file stream.
Parameter
Name
Description
credentialsStream
InputStream
the stream with the credential definition
Exceptions
Type
Description
IOException
if the credential cannot be created from the stream
public static ExternalAccountAuthorizedUserCredentials fromStream ( InputStream credentialsStream , HttpTransportFactory transportFactory )
Returns external account authorized user credentials defined by a JSON file stream.
Parameters
Name
Description
credentialsStream
InputStream
the stream with the credential definition
transportFactory
HttpTransportFactory
the HTTP transport factory used to create the transport to get access
tokens
Exceptions
Type
Description
IOException
if the credential cannot be created from the stream
newBuilder()
public static ExternalAccountAuthorizedUserCredentials . Builder newBuilder ()
Methods
equals(Object obj)
public boolean equals ( Object obj )
Parameter
Name
Description
obj
Object
Overrides
getAudience()
public String getAudience ()
Returns
Type
Description
String
getClientId()
public String getClientId ()
Returns
Type
Description
String
getClientSecret()
public String getClientSecret ()
Returns
Type
Description
String
getRefreshToken()
public String getRefreshToken ()
Returns
Type
Description
String
getRevokeUrl()
public String getRevokeUrl ()
Returns
Type
Description
String
getTokenInfoUrl()
public String getTokenInfoUrl ()
Returns
Type
Description
String
getTokenUrl()
public String getTokenUrl ()
Returns
Type
Description
String
hashCode()
Returns
Type
Description
int
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.
Overrides
toBuilder()
public ExternalAccountAuthorizedUserCredentials . Builder toBuilder ()
Overrides
toString()
Returns
Type
Description
String
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-01-27 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-27 UTC."],[],[]]