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 class
CloudShellCredentials.Builder
-
Nested classes/interfaces inherited from class com.google.auth.oauth2.OAuth2Credentials
OAuth2Credentials.CredentialsChangedListener
-
-
Field Summary
Fields Modifier and Type Field Description protected static 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.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 CloudShellCredentials
create(int authPort)
boolean
equals(Object obj)
protected int
getAuthPort()
int
hashCode()
static CloudShellCredentials.Builder
newBuilder()
AccessToken
refreshAccessToken()
Method to refresh the access token according to the specific type of credentials.CloudShellCredentials.Builder
toBuilder()
String
toString()
-
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: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 classOAuth2Credentials
-
toString
public String toString()
- Overrides:
toString
in classOAuth2Credentials
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classOAuth2Credentials
-
toBuilder
public CloudShellCredentials.Builder toBuilder()
- Overrides:
toBuilder
in classGoogleCredentials
-
newBuilder
public static CloudShellCredentials.Builder newBuilder()
-
-