Class TokenRequest
java.lang.Object
com.eqixiac.equinix.sts.model.json.creators.TokenRequest
An OAuth 2.0 token-exchange request body (RFC 8693) for
POST /v1/token (operationId
generateStsToken, spec schema TokenRequest).
Unlike the other request bodies in the SDK, this endpoint consumes
application/x-www-form-urlencoded, so this type exposes its fields as a name/value map
via toFormFields() rather than being JSON-serialized.
The form field names are the RFC 8693 ones (grant_type, scope,
subject_token, subject_token_type). The STS v1 spec's TokenRequest
schema lists camelCase names, but the live service answers unsupported_grant_type to
grantType and only parses the RFC names (probed 2026-11-11).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the OAuth 2.0 grant type (required), e.g.Sets the requested scope from a typedStsScope.Sets the requested scope for the access token.subjectToken(String subjectToken) Sets the ID token to exchange.subjectTokenType(String subjectTokenType) Sets the subject token type, e.g.Renders this request as an ordered map of form field name to value, omitting unset (null) fields.
-
Constructor Details
-
TokenRequest
public TokenRequest()
-
-
Method Details
-
grantType
Sets the OAuth 2.0 grant type (required), e.g.urn:ietf:params:oauth:grant-type:token-exchange.- Parameters:
grantType- the grant type- Returns:
- this request for chaining
-
scope
Sets the requested scope for the access token.The service accepts only an access-policy ERN,
roleassignments:<org-id>,projectpolicies:<project-id>orprincipalpolicy:<project-id>(live, 2026-11-11); preferscope(StsScope).- Parameters:
scope- the requested scope- Returns:
- this request for chaining
-
scope
Sets the requested scope from a typedStsScope.- Parameters:
scope- the requested scope- Returns:
- this request for chaining
-
subjectToken
Sets the ID token to exchange.- Parameters:
subjectToken- the subject token- Returns:
- this request for chaining
-
subjectTokenType
Sets the subject token type, e.g.urn:ietf:params:oauth:token-type:id_token.- Parameters:
subjectTokenType- the subject token type- Returns:
- this request for chaining
-
toFormFields
-