Record Class JwtClaims

java.lang.Object
java.lang.Record
io.fluxzero.idp.client.JwtClaims
Record Components:
issuer - issuer that signed the token
subject - stable OIDC subject
audiences - token audiences
issuedAt - token issued-at timestamp
notBefore - token not-before timestamp
expiresAt - token expiration timestamp
tokenUse - Fluxzero token use, for example id or access
tenantId - Fluxzero tenant id claim when present
name - display name when present
email - email address when present
json - complete JWT payload

public record JwtClaims(String issuer, String subject, List<String> audiences, Instant issuedAt, Instant notBefore, Instant expiresAt, String tokenUse, String tenantId, String name, String email, com.fasterxml.jackson.databind.JsonNode json) extends Record
Normalized claims extracted from a validated OIDC JWT.

This type is intentionally small and provider-neutral. Applications can use the common fields for their normal domain mapping and still access the raw JSON for tenant-specific claims when needed.

  • Constructor Details

    • JwtClaims

      public JwtClaims(String issuer, String subject, List<String> audiences, Instant issuedAt, Instant notBefore, Instant expiresAt, String tokenUse, String tenantId, String name, String email, com.fasterxml.jackson.databind.JsonNode json)
      Creates an instance of a JwtClaims record class.
      Parameters:
      issuer - the value for the issuer record component
      subject - the value for the subject record component
      audiences - the value for the audiences record component
      issuedAt - the value for the issuedAt record component
      notBefore - the value for the notBefore record component
      expiresAt - the value for the expiresAt record component
      tokenUse - the value for the tokenUse record component
      tenantId - the value for the tenantId record component
      name - the value for the name record component
      email - the value for the email record component
      json - the value for the json record component
  • Method Details

    • claim

      public String claim(String claimName)
      Returns a string claim from the raw payload.
      Parameters:
      claimName - claim name
      Returns:
      string value or an empty string when absent
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • issuer

      public String issuer()
      Returns the value of the issuer record component.
      Returns:
      the value of the issuer record component
    • subject

      public String subject()
      Returns the value of the subject record component.
      Returns:
      the value of the subject record component
    • audiences

      public List<String> audiences()
      Returns the value of the audiences record component.
      Returns:
      the value of the audiences record component
    • issuedAt

      public Instant issuedAt()
      Returns the value of the issuedAt record component.
      Returns:
      the value of the issuedAt record component
    • notBefore

      public Instant notBefore()
      Returns the value of the notBefore record component.
      Returns:
      the value of the notBefore record component
    • expiresAt

      public Instant expiresAt()
      Returns the value of the expiresAt record component.
      Returns:
      the value of the expiresAt record component
    • tokenUse

      public String tokenUse()
      Returns the value of the tokenUse record component.
      Returns:
      the value of the tokenUse record component
    • tenantId

      public String tenantId()
      Returns the value of the tenantId record component.
      Returns:
      the value of the tenantId record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • email

      public String email()
      Returns the value of the email record component.
      Returns:
      the value of the email record component
    • json

      public com.fasterxml.jackson.databind.JsonNode json()
      Returns the value of the json record component.
      Returns:
      the value of the json record component