Class StsTokenExchangeResponse (1.32.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 String getAccessBoundarySessionKey()

Returns the access boundary session key if present.

Returns
Type Description
String

the access boundary session key or null if not present

getAccessToken()

public AccessToken getAccessToken()
Returns
Type Description
AccessToken

getExpiresInSeconds()

public Long getExpiresInSeconds()
Returns
Type Description
Long

getIssuedTokenType()

public String getIssuedTokenType()
Returns
Type Description
String

getRefreshToken()

public String getRefreshToken()
Returns
Type Description
String

getScopes()

public List<String> getScopes()
Returns
Type Description
List<String>

getTokenType()

public String getTokenType()
Returns
Type Description
String