Package ca.cdr.test.app.clients
Record Class AccessTokenResponse
java.lang.Object
java.lang.Record
ca.cdr.test.app.clients.AccessTokenResponse
- Record Components:
accessToken- theaccess_tokentokenType- thetoken_type, normallyBearerexpiresIn- theexpires_inlifetime in seconds, if the server sent onescope- the grantedscope, if the server sent oneidToken- the OpenID Connectid_token, if one was issuedrefreshToken- therefresh_token, if one was issuedraw- the whole response, for any member not listed above
public record AccessTokenResponse(@Nonnull String accessToken, @Nullable String tokenType, @Nullable Long expiresIn, @Nullable String scope, @Nullable String idToken, @Nullable String refreshToken, @Nonnull com.fasterxml.jackson.databind.JsonNode raw)
extends Record
A successful OAuth 2.0 token endpoint response.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessTokenrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresInrecord component.static AccessTokenResponsefromJson(com.fasterxml.jackson.databind.JsonNode theResponse) Reads a token endpoint response body.final inthashCode()Returns a hash code value for this object.idToken()Returns the value of theidTokenrecord component.com.fasterxml.jackson.databind.JsonNoderaw()Returns the value of therawrecord component.Returns the value of therefreshTokenrecord component.scope()Returns the value of thescoperecord component.Returns the value of thetokenTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AccessTokenResponse
public AccessTokenResponse(@Nonnull String accessToken, @Nullable String tokenType, @Nullable Long expiresIn, @Nullable String scope, @Nullable String idToken, @Nullable String refreshToken, @Nonnull com.fasterxml.jackson.databind.JsonNode raw) Creates an instance of aAccessTokenResponserecord class.- Parameters:
accessToken- the value for theaccessTokenrecord componenttokenType- the value for thetokenTyperecord componentexpiresIn- the value for theexpiresInrecord componentscope- the value for thescoperecord componentidToken- the value for theidTokenrecord componentrefreshToken- the value for therefreshTokenrecord componentraw- the value for therawrecord component
-
-
Method Details
-
fromJson
@Nonnull public static AccessTokenResponse fromJson(@Nonnull com.fasterxml.jackson.databind.JsonNode theResponse) Reads a token endpoint response body.- Parameters:
theResponse- the parsed response body- Returns:
- the response
- Throws:
IllegalArgumentException- if the body carries noaccess_token
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
accessToken
Returns the value of theaccessTokenrecord component.- Returns:
- the value of the
accessTokenrecord component
-
tokenType
Returns the value of thetokenTyperecord component.- Returns:
- the value of the
tokenTyperecord component
-
expiresIn
Returns the value of theexpiresInrecord component.- Returns:
- the value of the
expiresInrecord component
-
scope
Returns the value of thescoperecord component.- Returns:
- the value of the
scoperecord component
-
idToken
Returns the value of theidTokenrecord component.- Returns:
- the value of the
idTokenrecord component
-
refreshToken
Returns the value of therefreshTokenrecord component.- Returns:
- the value of the
refreshTokenrecord component
-
raw
Returns the value of therawrecord component.- Returns:
- the value of the
rawrecord component
-