Class StsTokenExchangeResponse (1.50.0)

public final class StsTokenExchangeResponse

Represents a successful OAuth 2.0 token exchange response from the Google Security Token Service (STS), as defined in RFC 8693, Section 2.2.1.

This class provides access to the exchanged access token, issued token type, token type, expiration time, refresh token (optional), scopes (optional), and the access boundary session key (optional).

Instances are immutable. Use #newBuilder(String, String, String) to create an instance.

Inheritance

java.lang.Object > StsTokenExchangeResponse

Static Methods

newBuilder(String accessToken, String issuedTokenType, String tokenType)

public static StsTokenExchangeResponse.Builder newBuilder(String accessToken, String issuedTokenType, String tokenType)

Returns a new StsTokenExchangeResponse.Builder instance.

Parameters
Name Description
accessToken String

The exchanged access token.

issuedTokenType String

The issued token type. For example, OAuth2Utils#TOKEN_TYPE_ACCESS_TOKEN.

tokenType String

The token type (e.g., "Bearer").

Returns
Type Description
StsTokenExchangeResponse.Builder

A new builder for creating StsTokenExchangeResponse instances.

Methods

getAccessBoundarySessionKey()

public @Nullable String getAccessBoundarySessionKey()

Returns the access boundary session key if present.

Returns
Type Description
@org.jspecify.annotations.Nullable java.lang.String

the access boundary session key or null if not present

getAccessToken()

public AccessToken getAccessToken()
Returns
Type Description
AccessToken

getExpiresInSeconds()

public @Nullable Long getExpiresInSeconds()
Returns
Type Description
@org.jspecify.annotations.Nullable java.lang.Long

getIssuedTokenType()

public String getIssuedTokenType()
Returns
Type Description
String

getRefreshToken()

public @Nullable String getRefreshToken()
Returns
Type Description
@org.jspecify.annotations.Nullable java.lang.String

getScopes()

public @Nullable List<String> getScopes()
Returns
Type Description
@org.jspecify.annotations.Nullable java.util.List<String>

getTokenType()

public String getTokenType()
Returns
Type Description
String