Class UserCredentials (1.3.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicclass UserCredentialsextendsGoogleCredentialsimplementsQuotaProjectIdProvider,IdTokenProviderOAuth2 Credentials representing a user's identity and consent.
Inherited Members
Methods
equals(Object obj)
publicbooleanequals(Objectobj)fromStream(InputStream credentialsStream)
publicstaticUserCredentialsfromStream(InputStreamcredentialsStream)Returns credentials defined by a JSON file stream using the format supported by the Cloud SDK.
the credential defined by the credentialsStream.
if the credential cannot be created from the stream.
fromStream(InputStream credentialsStream, HttpTransportFactory transportFactory)
publicstaticUserCredentialsfromStream(InputStreamcredentialsStream,HttpTransportFactorytransportFactory)Returns credentials defined by a JSON file stream using the format supported by the Cloud SDK.
HttpTransportFactory HTTP transport factory, creates the transport used to get access tokens.
the credential defined by the credentialsStream.
if the credential cannot be created from the stream.
getAdditionalHeaders()
protectedMap<String,List<String>>getAdditionalHeaders()Provide additional headers to return as request metadata.
getClientId()
publicfinalStringgetClientId()Returns client ID of the credential from the console.
client ID
getClientSecret()
publicfinalStringgetClientSecret()Returns client secret of the credential from the console.
client secret
getQuotaProjectId()
publicStringgetQuotaProjectId()getRefreshToken()
publicfinalStringgetRefreshToken()Returns the refresh token resulting from a OAuth2 consent flow.
refresh token
hashCode()
publicinthashCode()idTokenWithAudience(String targetAudience, List<IdTokenProvider.Option> options)
publicIdTokenidTokenWithAudience(StringtargetAudience,List<IdTokenProvider.Option>options)Returns a Google ID Token from the refresh token response.
List<Option>list of Credential specific options for the token. Currently unused for UserCredentials.
IdToken object which includes the raw id_token, expiration and audience
if the attempt to get an IdToken failed
newBuilder()
publicstaticUserCredentials.BuildernewBuilder()refreshAccessToken()
publicAccessTokenrefreshAccessToken()Refreshes the OAuth2 access token by getting a new access token from the refresh token
save(String filePath)
publicvoidsave(StringfilePath)Saves the end user credentials into the given file path.
An error storing the credentials.
toBuilder()
publicUserCredentials.BuildertoBuilder()toString()
publicStringtoString()