Class StsTokenExchangeRequest (1.40.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.
Static Methods
newBuilder(String subjectToken, String subjectTokenType)
public static StsTokenExchangeRequest.Builder newBuilder(String subjectToken, String subjectTokenType)
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.
|
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()
getSubjectToken()
public String getSubjectToken()
Returns |
Type |
Description |
String |
|
getSubjectTokenType()
public String getSubjectTokenType()
Returns |
Type |
Description |
String |
|
hasActingParty()
public boolean hasActingParty()
hasAudience()
public boolean hasAudience()
hasRequestedTokenType()
public boolean hasRequestedTokenType()
hasResource()
public boolean hasResource()
hasScopes()
public boolean hasScopes()
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."],[],[]]