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.AsyncRefreshResult, OAuth2Credentials.CacheState, OAuth2Credentials.CredentialsChangedListener, OAuth2Credentials.FutureCallbackToMetadataCallbackAdapter, OAuth2Credentials.OAuthValue, OAuth2Credentials.RefreshTask, OAuth2Credentials.RefreshTaskListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final int
protected static final String
The Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character.protected static final byte[]
private static final int
private static final long
Fields inherited from class com.google.auth.oauth2.GoogleCredentials
GDCH_SERVICE_ACCOUNT_FILE_TYPE, QUOTA_PROJECT_ID_HEADER_KEY, quotaProjectId, SERVICE_ACCOUNT_FILE_TYPE, USER_FILE_TYPE
Fields inherited from class com.google.auth.oauth2.OAuth2Credentials
clock, DEFAULT_EXPIRATION_MARGIN, DEFAULT_REFRESH_MARGIN, lock, refreshTask
Fields inherited from class com.google.auth.Credentials
GOOGLE_DEFAULT_UNIVERSE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
-
Method Summary
Modifier and TypeMethodDescriptionstatic CloudShellCredentials
create
(int authPort) boolean
protected int
int
hashCode()
Method to refresh the access token according to the specific type of credentials.toString()
Methods inherited from class com.google.auth.oauth2.GoogleCredentials
addQuotaProjectIdToRequestMetadata, create, create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, fromStream, fromStream, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectId, getUniverseDomain, isDefaultUniverseDomain, isExplicitUniverseDomain, toStringHelper
Methods inherited from class com.google.auth.oauth2.OAuth2Credentials
addChangeListener, getAccessToken, getAuthenticationType, getExpirationMargin, getFromServiceLoader, getRefreshMargin, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListener
Methods inherited from class com.google.auth.Credentials
blockingGetToCallback, getMetricsCredentialType, getRequestMetadata
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
ACCESS_TOKEN_INDEX
private static final int ACCESS_TOKEN_INDEX- See Also:
-
READ_TIMEOUT_MS
private static final int READ_TIMEOUT_MS- See Also:
-
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 -
authPort
private final int authPort
-
-
Constructor Details
-
CloudShellCredentials
-
-
Method Details
-
create
-
getAuthPort
protected int getAuthPort() -
refreshAccessToken
Description copied from class:OAuth2Credentials
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:
refreshAccessToken
in classOAuth2Credentials
- Returns:
- never
- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCode
in classGoogleCredentials
-
toString
- Overrides:
toString
in classGoogleCredentials
-
equals
- Overrides:
equals
in classGoogleCredentials
-
toBuilder
- Overrides:
toBuilder
in classGoogleCredentials
-
newBuilder
-