java.lang.Object
java.lang.Record
com.irurueta.authserver.authorization.domain.passkeys.Passkey
Record Components:
id - credential identifier, as the unpadded base64url text Spring Security stores.
userId - WebAuthn user handle of the owner, as the unpadded base64url text Spring Security stores.
label - name the user gave to the passkey.
createdAt - instant at which the passkey was registered.
lastUsedAt - instant of the last sign-in with it, or null when it has never been used.
signatureCount - signature counter reported by the authenticator at its last use.
backupEligible - whether the authenticator allows the credential to be backed up (synced).
backedUp - whether the credential is currently backed up.

public record Passkey(String id, String userId, String label, Instant createdAt, Instant lastUsedAt, long signatureCount, boolean backupEligible, boolean backedUp) extends Record
A passkey (WebAuthn credential) registered by a user. Only the data a user manages is modelled; the public key and attestation stay in the framework's store.
  • Field Details

    • id

      private final String id
      The field for the id record component.
    • userId

      private final String userId
      The field for the userId record component.
    • label

      private final String label
      The field for the label record component.
    • createdAt

      private final Instant createdAt
      The field for the createdAt record component.
    • lastUsedAt

      private final Instant lastUsedAt
      The field for the lastUsedAt record component.
    • signatureCount

      private final long signatureCount
      The field for the signatureCount record component.
    • backupEligible

      private final boolean backupEligible
      The field for the backupEligible record component.
    • backedUp

      private final boolean backedUp
      The field for the backedUp record component.
  • Constructor Details

    • Passkey

      public Passkey(String id, String userId, String label, Instant createdAt, Instant lastUsedAt, long signatureCount, boolean backupEligible, boolean backedUp)
      Validates the passkey.
      Throws:
      IllegalArgumentException - if the id, owner or label is blank, the creation instant is missing, or the signature counter is negative.
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • userId

      public String userId()
      Returns the value of the userId record component.
      Returns:
      the value of the userId record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • createdAt

      public Instant createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • lastUsedAt

      public Instant lastUsedAt()
      Returns the value of the lastUsedAt record component.
      Returns:
      the value of the lastUsedAt record component
    • signatureCount

      public long signatureCount()
      Returns the value of the signatureCount record component.
      Returns:
      the value of the signatureCount record component
    • backupEligible

      public boolean backupEligible()
      Returns the value of the backupEligible record component.
      Returns:
      the value of the backupEligible record component
    • backedUp

      public boolean backedUp()
      Returns the value of the backedUp record component.
      Returns:
      the value of the backedUp record component