Class CloudShellCredentials (1.27.0)

public class CloudShellCredentials extends GoogleCredentials

OAuth2 credentials representing the built-in service account for Google Cloud Shell.

Inheritance

Object > Credentials > OAuth2Credentials > GoogleCredentials > CloudShellCredentials

Static Fields

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.

Field Value
Type Description
String

GET_AUTH_TOKEN_REQUEST_BYTES

protected static final byte[] GET_AUTH_TOKEN_REQUEST_BYTES
Field Value
Type Description
byte[]

Static Methods

create(int authPort)

public static CloudShellCredentials create(int authPort)
Parameter
Name Description
authPort int
Returns
Type Description
CloudShellCredentials

newBuilder()

public static CloudShellCredentials.Builder newBuilder()
Returns
Type Description
CloudShellCredentials.Builder

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAuthPort()

protected int getAuthPort()
Returns
Type Description
int

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

refreshAccessToken()

public AccessToken refreshAccessToken()

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.

Returns
Type Description
AccessToken
Overrides
Exceptions
Type Description
IOException

toBuilder()

public CloudShellCredentials.Builder toBuilder()
Returns
Type Description
CloudShellCredentials.Builder
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides