Class StsTokenExchangeResponse (1.33.1)

publicfinalclass 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)

publicstaticStsTokenExchangeResponse.BuildernewBuilder(StringaccessToken,StringissuedTokenType,StringtokenType)

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()

publicStringgetAccessBoundarySessionKey()

Returns the access boundary session key if present.

Returns
Type Description
String

the access boundary session key or null if not present

getAccessToken()

publicAccessTokengetAccessToken()
Returns
Type Description
AccessToken

getExpiresInSeconds()

publicLonggetExpiresInSeconds()
Returns
Type Description
Long

getIssuedTokenType()

publicStringgetIssuedTokenType()
Returns
Type Description
String

getRefreshToken()

publicStringgetRefreshToken()
Returns
Type Description
String

getScopes()

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

getTokenType()

publicStringgetTokenType()
Returns
Type Description
String

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.