Class TokenResponse
java.lang.Object
co.ankatech.keymanagement.client.auth.model.TokenResponse
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class TokenResponse
extends Object
OAuth 2.0 token response (RFC 6749 §5.1) for every grant. The token-exchange grant answers with the same format plus issued_token_type and scope (RFC 8693 §2.2.1), and without refresh_token and passwordChangeEligible
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumToken type (RFC 6749 §7.1): 'Bearer' on every grant, except 'DPoP' (RFC 9449 §5) for an administrative workload's client_credentials grant sent with a DPoP proof, whose token is bound to the proof key -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessToken(String accessToken) booleanstatic TokenResponseCreate an instance of TokenResponse given an JSON stringJWT access token used for authenticating API requestsAccess token lifetime in seconds (typically 36000 = 10 hours)URI identifying the type of the issued token (RFC 8693 §2.2.1).Whether the account this token names holds a password managed by ANKASecure and may therefore change it through POST /api/v3/auth/account/password/change.Sent as null on the grants that issue a person's session (authorization_code and refresh_token), which deliver the refresh token in an HttpOnly cookie, and on the client_credentials grant, which issues none (RFC 6749 §4.4.3).getScope()Space-delimited list of the granted scopes (RFC 6749 §5.1, RFC 8693 §2.2.1).Token type (RFC 6749 §7.1): 'Bearer' on every grant, except 'DPoP' (RFC 9449 §5) for an administrative workload's client_credentials grant sent with a DPoP proof, whose token is bound to the proof keyThe wire value oftoken_type: what the server sent, verbatim.inthashCode()issuedTokenType(String issuedTokenType) passwordChangeEligible(Boolean passwordChangeEligible) refreshToken(String refreshToken) voidsetAccessToken(String accessToken) voidsetExpiresIn(Integer expiresIn) voidsetIssuedTokenType(String issuedTokenType) voidsetPasswordChangeEligible(Boolean passwordChangeEligible) voidsetRefreshToken(String refreshToken) voidvoidsetTokenType(TokenResponse.TokenTypeEnum tokenType) toJson()Convert an instance of TokenResponse to an JSON stringtokenType(TokenResponse.TokenTypeEnum tokenType) toString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues foundstatic voidvalidateJsonElementAsCandidate(com.google.gson.JsonElement jsonElement) Validates the JSON Element as a candidate of a oneOf schema: the checks ofvalidateJsonElement(JsonElement), and the element carries no member this model does not declare.
-
Field Details
-
SERIALIZED_NAME_ACCESS_TOKEN
- See Also:
-
SERIALIZED_NAME_REFRESH_TOKEN
- See Also:
-
SERIALIZED_NAME_TOKEN_TYPE
- See Also:
-
SERIALIZED_NAME_EXPIRES_IN
- See Also:
-
SERIALIZED_NAME_PASSWORD_CHANGE_ELIGIBLE
- See Also:
-
SERIALIZED_NAME_ISSUED_TOKEN_TYPE
- See Also:
-
SERIALIZED_NAME_SCOPE
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
TokenResponse
public TokenResponse()
-
-
Method Details
-
getTokenTypeAsString
The wire value oftoken_type: what the server sent, verbatim.- For a value this release declares, the same wire value the enum names.
- For a value it does not declare (one a later server added), the server's wire value verbatim,
while
getTokenType()readsUNKNOWN_DEFAULT_OPEN_API; writing this model sends that wire value back, never the sentinel. - For an absent member,
null.
- Returns:
- the wire value, or
nullwhen the member is absent
-
accessToken
-
getAccessToken
JWT access token used for authenticating API requests- Returns:
- accessToken
-
setAccessToken
-
refreshToken
-
getRefreshToken
Sent as null on the grants that issue a person's session (authorization_code and refresh_token), which deliver the refresh token in an HttpOnly cookie, and on the client_credentials grant, which issues none (RFC 6749 §4.4.3). Absent on the token-exchange grant (RFC 8693 §2.2.1).- Returns:
- refreshToken
-
setRefreshToken
-
tokenType
-
getTokenType
Token type (RFC 6749 §7.1): 'Bearer' on every grant, except 'DPoP' (RFC 9449 §5) for an administrative workload's client_credentials grant sent with a DPoP proof, whose token is bound to the proof key- Returns:
- tokenType
-
setTokenType
-
expiresIn
-
getExpiresIn
Access token lifetime in seconds (typically 36000 = 10 hours)- Returns:
- expiresIn
-
setExpiresIn
-
passwordChangeEligible
-
getPasswordChangeEligible
Whether the account this token names holds a password managed by ANKASecure and may therefore change it through POST /api/v3/auth/account/password/change. False for an account whose credential is held by an external identity provider, and false on every grant that does not resolve the fact (refresh_token, client_credentials). Present on the password, tenant-selection, client_credentials and refresh_token grants; absent on the token-exchange grant. It is a rendering hint for the console, never an authorization decision: the change endpoint refuses the same subject regardless of what this says.- Returns:
- passwordChangeEligible
-
setPasswordChangeEligible
-
issuedTokenType
-
getIssuedTokenType
URI identifying the type of the issued token (RFC 8693 §2.2.1). Present on the token-exchange grant only.- Returns:
- issuedTokenType
-
setIssuedTokenType
-
scope
-
getScope
Space-delimited list of the granted scopes (RFC 6749 §5.1, RFC 8693 §2.2.1). Present on the token-exchange grant only.- Returns:
- scope
-
setScope
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to TokenResponse
-
validateJsonElementAsCandidate
public static void validateJsonElementAsCandidate(com.google.gson.JsonElement jsonElement) throws IOException Validates the JSON Element as a candidate of a oneOf schema: the checks ofvalidateJsonElement(JsonElement), and the element carries no member this model does not declare. A oneOf schema without a discriminator tells its candidates apart by their member sets, so a candidate is matched on its closed member set.- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is not a TokenResponse
-
fromJson
Create an instance of TokenResponse given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of TokenResponse
- Throws:
IOException- if the JSON string is invalid with respect to TokenResponse
-
toJson
Convert an instance of TokenResponse to an JSON string- Returns:
- JSON string
-