Package com.google.auth.oauth2
Class CloudShellCredentials
java.lang.Object
com.google.auth.Credentials
com.google.auth.oauth2.OAuth2Credentials
com.google.auth.oauth2.GoogleCredentials
com.google.auth.oauth2.CloudShellCredentials
- All Implemented Interfaces:
QuotaProjectIdProvider,Serializable
OAuth2 credentials representing the built-in service account for Google Cloud Shell.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.google.auth.oauth2.OAuth2Credentials
OAuth2Credentials.CredentialsChangedListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final StringThe Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character.protected static final byte[]Fields inherited from class com.google.auth.oauth2.GoogleCredentials
quotaProjectIdFields inherited from class com.google.auth.Credentials
GOOGLE_DEFAULT_UNIVERSE -
Method Summary
Modifier and TypeMethodDescriptionstatic CloudShellCredentialscreate(int authPort) booleanprotected intinthashCode()Method to refresh the access token according to the specific type of credentials.toString()Returns a string representation of this credential, including request metadata and access token.Methods inherited from class com.google.auth.oauth2.GoogleCredentials
create, create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, fromStream, fromStream, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getCredentialInfo, getProjectId, getQuotaProjectId, getUniverseDomain, isExplicitUniverseDomain, toStringHelperMethods inherited from class com.google.auth.oauth2.OAuth2Credentials
addChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListenerMethods inherited from class com.google.auth.Credentials
blockingGetToCallback, getMetricsCredentialType, getRequestMetadata
-
Field Details
-
GET_AUTH_TOKEN_REQUEST
The Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character. However, the request message has no content, so a token request consists of an empty JsPb, and its 2 character length prefix.- See Also:
-
GET_AUTH_TOKEN_REQUEST_BYTES
protected static final byte[] GET_AUTH_TOKEN_REQUEST_BYTES
-
-
Method Details
-
create
-
getAuthPort
protected int getAuthPort() -
refreshAccessToken
Description copied from class:OAuth2CredentialsMethod 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:
refreshAccessTokenin classOAuth2Credentials- Returns:
- never
- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classGoogleCredentials
-
toString
Description copied from class:OAuth2CredentialsReturns a string representation of this credential, including request metadata and access token.Security Warning: The output of this method includes the request metadata which contains the raw Bearer access token, and the raw access token value. Do not log this output in production environments as it may expose sensitive credentials.
- Overrides:
toStringin classGoogleCredentials
-
equals
- Overrides:
equalsin classGoogleCredentials
-
toBuilder
- Overrides:
toBuilderin classGoogleCredentials
-
newBuilder
-