Class CloudShellCredentials (1.40.0)
public class CloudShellCredentials extends GoogleCredentials
OAuth2 credentials representing the built-in service account for Google Cloud Shell.
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
|
newBuilder()
public static CloudShellCredentials.Builder newBuilder()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
Name |
Description |
obj |
Object
|
Overrides
getAuthPort()
protected int getAuthPort()
Returns |
Type |
Description |
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.
Overrides
toBuilder()
public CloudShellCredentials.Builder toBuilder()
Overrides
toString()
Returns |
Type |
Description |
String |
|
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-15 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-15 UTC."],[],[]]