Class StsTokenExchangeRequest (1.32.0)

public final class StsTokenExchangeRequest

Represents an OAuth 2.0 token exchange request, as defined in RFC 8693, Section 2.1.

This class encapsulates the parameters necessary for making a token exchange request to Google Security Token Service (STS). It includes the subject token, subject token type, optional parameters like acting party, scopes, resource, audience, requested token type, and internal options.

Instances of this class are immutable. Use the #newBuilder(String, String) method to create a new builder.

Inheritance

java.lang.Object > StsTokenExchangeRequest

Static Methods

newBuilder(String subjectToken, String subjectTokenType)

public static StsTokenExchangeRequest.Builder newBuilder(String subjectToken, String subjectTokenType)

Returns a new StsTokenExchangeRequest.Builder instance.

Parameters
Name Description
subjectToken String

The token being exchanged. This represents the credentials being used to authorize the token exchange request.

subjectTokenType String

The type of the subjectToken. For example, OAuth2Utils#TOKEN_TYPE_ACCESS_TOKEN.

Returns
Type Description
StsTokenExchangeRequest.Builder

A new builder for creating StsTokenExchangeRequest instances.

Methods

getActingParty()

public ActingParty getActingParty()
Returns
Type Description
com.google.auth.oauth2.ActingParty

getAudience()

public String getAudience()
Returns
Type Description
String

getGrantType()

public String getGrantType()
Returns
Type Description
String

getInternalOptions()

public String getInternalOptions()
Returns
Type Description
String

getRequestedTokenType()

public String getRequestedTokenType()
Returns
Type Description
String

getResource()

public String getResource()
Returns
Type Description
String

getScopes()

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

getSubjectToken()

public String getSubjectToken()
Returns
Type Description
String

getSubjectTokenType()

public String getSubjectTokenType()
Returns
Type Description
String

hasActingParty()

public boolean hasActingParty()
Returns
Type Description
boolean

hasAudience()

public boolean hasAudience()
Returns
Type Description
boolean

hasRequestedTokenType()

public boolean hasRequestedTokenType()
Returns
Type Description
boolean

hasResource()

public boolean hasResource()
Returns
Type Description
boolean

hasScopes()

public boolean hasScopes()
Returns
Type Description
boolean