Class WebAuthnCredentialRecord

java.lang.Object
com.webauthn4j.authenticator.CoreAuthenticatorImpl
com.webauthn4j.credential.CoreCredentialRecordImpl
com.webauthn4j.credential.CredentialRecordImpl
io.quarkus.security.webauthn.WebAuthnCredentialRecord
All Implemented Interfaces:
com.webauthn4j.authenticator.Authenticator, com.webauthn4j.authenticator.CoreAuthenticator, com.webauthn4j.credential.CoreCredentialRecord, com.webauthn4j.credential.CredentialRecord

public class WebAuthnCredentialRecord extends com.webauthn4j.credential.CredentialRecordImpl
This is the internal WebAuthn4J representation for a credential record, augmented with a user name. One user name can be shared among multiple credential records, but each credential record has a unique credential ID.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    Record holding all the required persistent fields for logging back someone over WebAuthn.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebAuthnCredentialRecord(String username, com.webauthn4j.data.attestation.AttestationObject attestationObject, com.webauthn4j.data.client.CollectedClientData clientData, com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs<com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput> clientExtensions, Set<com.webauthn4j.data.AuthenticatorTransport> transports)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Reassembles a credential record from the given required persisted fields.
    long
    The increasing signature counter for usage of this credential record.
    The unique credential ID for this record.
    Returns the fields of this credential record that are necessary to persist for your users to be able to log back in using WebAuthn.
    The username for this credential record

    Methods inherited from class com.webauthn4j.credential.CredentialRecordImpl

    equals, getClientData, getClientExtensions, getTransports, hashCode

    Methods inherited from class com.webauthn4j.credential.CoreCredentialRecordImpl

    isBackedUp, isBackupEligible, isUvInitialized, setBackedUp, setBackupEligible, setUvInitialized

    Methods inherited from class com.webauthn4j.authenticator.CoreAuthenticatorImpl

    createFromCoreRegistrationData, getAttestationStatement, getAttestedCredentialData, getAuthenticatorExtensions, setAttestationStatement, setAttestedCredentialData, setAuthenticatorExtensions, setCounter

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.webauthn4j.authenticator.CoreAuthenticator

    getAttestationStatement, getAttestedCredentialData, getAuthenticatorExtensions, setCounter

    Methods inherited from interface com.webauthn4j.credential.CoreCredentialRecord

    isBackedUp, isBackupEligible, isUvInitialized, setBackedUp, setBackupEligible, setUvInitialized
  • Constructor Details

    • WebAuthnCredentialRecord

      public WebAuthnCredentialRecord(String username, com.webauthn4j.data.attestation.AttestationObject attestationObject, com.webauthn4j.data.client.CollectedClientData clientData, com.webauthn4j.data.extension.client.AuthenticationExtensionsClientOutputs<com.webauthn4j.data.extension.client.RegistrationExtensionClientOutput> clientExtensions, Set<com.webauthn4j.data.AuthenticatorTransport> transports)
  • Method Details

    • getCounter

      public long getCounter()
      The increasing signature counter for usage of this credential record. See https://w3c.github.io/webauthn/#signature-counter
      Specified by:
      getCounter in interface com.webauthn4j.authenticator.CoreAuthenticator
      Overrides:
      getCounter in class com.webauthn4j.authenticator.CoreAuthenticatorImpl
      Returns:
      The increasing signature counter.
    • getUsername

      public String getUsername()
      The username for this credential record
      Returns:
      the username for this credential record
    • getCredentialID

      public String getCredentialID()
      The unique credential ID for this record. This is a convenience method returning a Base64Url-encoded version of getAttestedCredentialData().getCredentialId()
      Returns:
      The unique credential ID for this record
    • getRequiredPersistedData

      public WebAuthnCredentialRecord.RequiredPersistedData getRequiredPersistedData()
      Returns the fields of this credential record that are necessary to persist for your users to be able to log back in using WebAuthn.
      Returns:
      the fields required to be persisted.
    • fromRequiredPersistedData

      public static WebAuthnCredentialRecord fromRequiredPersistedData(WebAuthnCredentialRecord.RequiredPersistedData persistedData)
      Reassembles a credential record from the given required persisted fields.
      Parameters:
      persistedData - the required fields to be able to log back in with WebAuthn.
      Returns:
      the internal representation of a WebAuthn credential record.