Class CloudShellCredentials (1.3.0)

publicclass CloudShellCredentialsextendsGoogleCredentials

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

Inheritance

Object > Credentials > OAuth2Credentials > GoogleCredentials > CloudShellCredentials

Inherited Members

Fields

GET_AUTH_TOKEN_REQUEST

protectedstaticfinalStringGET_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

GET_AUTH_TOKEN_REQUEST_BYTES

protectedstaticfinalbyte[]GET_AUTH_TOKEN_REQUEST_BYTES
Field Value
Type Description
byte[]

Methods

create(int authPort)

publicstaticCloudShellCredentialscreate(intauthPort)
Parameter
Name Description
authPort int
Returns
Type Description

equals(Object obj)

publicbooleanequals(Objectobj)
Parameter
Name Description
obj Object
Returns
Type Description
Overrides

getAuthPort()

protectedintgetAuthPort()
Returns
Type Description
int

hashCode()

publicinthashCode()
Returns
Type Description
int
Overrides

newBuilder()

publicstaticCloudShellCredentials.BuildernewBuilder()
Returns
Type Description

refreshAccessToken()

publicAccessTokenrefreshAccessToken()

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
Overrides Exceptions
Type Description

toBuilder()

publicCloudShellCredentials.BuildertoBuilder()
Returns
Type Description
Overrides

toString()

publicStringtoString()
Returns
Type Description
Overrides

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年10月30日 UTC.