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
public class CloudShellCredentials extends GoogleCredentials
OAuth2 credentials representing the built-in service account for Google Cloud Shell.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCloudShellCredentials.Builder-
Nested classes/interfaces inherited from class com.google.auth.oauth2.OAuth2Credentials
OAuth2Credentials.CredentialsChangedListener
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringGET_AUTH_TOKEN_REQUESTThe Cloud Shell back authorization channel uses serialized Javascript Protobuffers, preceded by the message length and a new line character.protected static byte[]GET_AUTH_TOKEN_REQUEST_BYTES-
Fields inherited from class com.google.auth.oauth2.GoogleCredentials
quotaProjectId
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CloudShellCredentialscreate(int authPort)booleanequals(Object obj)protected intgetAuthPort()inthashCode()static CloudShellCredentials.BuildernewBuilder()AccessTokenrefreshAccessToken()Method to refresh the access token according to the specific type of credentials.CloudShellCredentials.BuildertoBuilder()StringtoString()-
Methods inherited from class com.google.auth.oauth2.GoogleCredentials
create, createDelegated, createScoped, createScoped, createScoped, createScopedRequired, createWithCustomRetryStrategy, createWithQuotaProject, fromStream, fromStream, getAdditionalHeaders, getApplicationDefault, getApplicationDefault, getQuotaProjectId
-
Methods inherited from class com.google.auth.oauth2.OAuth2Credentials
addChangeListener, getAccessToken, getAuthenticationType, getFromServiceLoader, getRequestMetadata, getRequestMetadata, getRequestMetadataInternal, hasRequestMetadata, hasRequestMetadataOnly, newInstance, refresh, refreshIfExpired, removeChangeListener
-
Methods inherited from class com.google.auth.Credentials
blockingGetToCallback, getRequestMetadata
-
-
-
-
Field Detail
-
GET_AUTH_TOKEN_REQUEST
protected static final String 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:
- Constant Field Values
-
GET_AUTH_TOKEN_REQUEST_BYTES
protected static final byte[] GET_AUTH_TOKEN_REQUEST_BYTES
-
-
Method Detail
-
create
public static CloudShellCredentials create(int authPort)
-
getAuthPort
protected int getAuthPort()
-
refreshAccessToken
public AccessToken refreshAccessToken() throws IOException
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 classOAuth2Credentials
-
toString
public String toString()
- Overrides:
toStringin classOAuth2Credentials
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classOAuth2Credentials
-
toBuilder
public CloudShellCredentials.Builder toBuilder()
- Overrides:
toBuilderin classGoogleCredentials
-
newBuilder
public static CloudShellCredentials.Builder newBuilder()
-
-