Record Class TokenValidationRequest
java.lang.Object
java.lang.Record
io.fluxzero.idp.client.TokenValidationRequest
- Record Components:
token- compact serialized JWTissuer- exact issuer expected in theissclaimaudiences- accepted audiences for this validation contextexpectedTokenUse- expected Fluxzerotoken_usevalue, or blank to skip the checknow- clock value used for temporal validationleeway- tolerated clock skew for temporal validation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TokenValidationRequestaccessToken(String token, OidcTenantConfig config) Creates a validation request for a bearer access token sent to backend APIs.Returns the value of theaudiencesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectedTokenUserecord component.final inthashCode()Returns a hash code value for this object.static TokenValidationRequestidToken(String token, OidcTenantConfig config) Creates a validation request for an ID token returned to the BFF callback.issuer()Returns the value of theissuerrecord component.leeway()Returns the value of theleewayrecord component.now()Returns the value of thenowrecord component.token()Returns the value of thetokenrecord component.final StringtoString()Returns a string representation of this record class.Returns a copy with a deterministic clock value.
-
Constructor Details
-
TokenValidationRequest
public TokenValidationRequest(String token, String issuer, List<String> audiences, String expectedTokenUse, Instant now, Duration leeway) Creates an instance of aTokenValidationRequestrecord class.- Parameters:
token- the value for thetokenrecord componentissuer- the value for theissuerrecord componentaudiences- the value for theaudiencesrecord componentexpectedTokenUse- the value for theexpectedTokenUserecord componentnow- the value for thenowrecord componentleeway- the value for theleewayrecord component
-
-
Method Details
-
idToken
Creates a validation request for an ID token returned to the BFF callback.ID tokens are intended for the application client, so the accepted audience is the configured client id.
- Parameters:
token- compact serialized ID tokenconfig- tenant configuration- Returns:
- validation request for an ID token
-
accessToken
Creates a validation request for a bearer access token sent to backend APIs.Access tokens are intended for a resource/API audience, not for the application client id.
- Parameters:
token- compact serialized access tokenconfig- tenant configuration- Returns:
- validation request for an access token
-
withNow
Returns a copy with a deterministic clock value.- Parameters:
newNow- clock value to validate against- Returns:
- copy with the supplied clock value
-
toString
-
hashCode
-
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). -
token
-
issuer
-
audiences
-
expectedTokenUse
Returns the value of theexpectedTokenUserecord component.- Returns:
- the value of the
expectedTokenUserecord component
-
now
-
leeway
-