Record Class TokenResponse
java.lang.Object
java.lang.Record
com.irurueta.authserver.serviceclient.device.TokenResponse
- Record Components:
accessToken- the access token; a secret.refreshToken- the refresh token, ornullwhen none was issued; a secret.tokenType- the token type, normallyBearer.expiresIn- seconds the access token lives.scope- the granted scopes separated by spaces, ornull.
public record TokenResponse(String accessToken, String refreshToken, String tokenType, long expiresIn, String scope)
extends Record
Successful response of the token endpoint (RFC 6749 section 5.1).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe field for theaccessTokenrecord component.private final longThe field for theexpiresInrecord component.private final StringThe field for therefreshTokenrecord component.private final StringThe field for thescoperecord component.private final StringThe field for thetokenTyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTokenResponse(String accessToken, String refreshToken, String tokenType, long expiresIn, String scope) Creates an instance of aTokenResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccessTokenrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theexpiresInrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of therefreshTokenrecord component.scope()Returns the value of thescoperecord component.Returns the value of thetokenTyperecord component.toString()Hides both tokens so that a log line or a stack trace never leaks them.
-
Field Details
-
accessToken
The field for theaccessTokenrecord component. -
refreshToken
The field for therefreshTokenrecord component. -
tokenType
The field for thetokenTyperecord component. -
expiresIn
private final long expiresInThe field for theexpiresInrecord component. -
scope
The field for thescoperecord component.
-
-
Constructor Details
-
TokenResponse
public TokenResponse(String accessToken, String refreshToken, String tokenType, long expiresIn, String scope) Creates an instance of aTokenResponserecord class.- Parameters:
accessToken- the value for theaccessTokenrecord componentrefreshToken- the value for therefreshTokenrecord componenttokenType- the value for thetokenTyperecord componentexpiresIn- the value for theexpiresInrecord componentscope- the value for thescoperecord component
-
-
Method Details
-
toString
Hides both tokens so that a log line or a stack trace never leaks them. -
hashCode
public final int 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
accessToken
Returns the value of theaccessTokenrecord component.- Returns:
- the value of the
accessTokenrecord component
-
refreshToken
Returns the value of therefreshTokenrecord component.- Returns:
- the value of the
refreshTokenrecord component
-
tokenType
Returns the value of thetokenTyperecord component.- Returns:
- the value of the
tokenTyperecord component
-
expiresIn
public long 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
-