Class WebAuthnAuthentication

java.lang.Object
com.codename1.backend.security.AbstractAuthenticationToken
com.codename1.backend.security.webauthn.WebAuthnAuthentication
All Implemented Interfaces:
Authentication

public final class WebAuthnAuthentication extends AbstractAuthenticationToken

Who signed in with a passkey.

The principal is the PublicKeyCredentialUserEntity of the user; the name is the user's name, the one the application's user store knows them by, and the authorities are the ones that store gives them. Beside those it says which credential signed, and whether the authenticator verified the user for it.

It stays one on the requests that follow: the session keeps what is here.

  • Constructor Details

    • WebAuthnAuthentication

      public WebAuthnAuthentication(PublicKeyCredentialUserEntity principal, Collection<? extends GrantedAuthority> authorities, byte[] credentialId, boolean userVerified)
      Parameters:
      credentialId - the credential that signed; may be null when it is not known
  • Method Details

    • getPrincipal

      public PublicKeyCredentialUserEntity getPrincipal()
      Description copied from interface: Authentication
      The identity: a username before authentication, and afterwards usually the UserDetails it was resolved to.
    • getCredentials

      public Object getCredentials()
      Description copied from interface: Authentication
      What proves the principal is who it says: a password, usually, and null once it has been checked.
    • getName

      public String getName()
      Description copied from interface: Authentication
      The principal's name.
      Specified by:
      getName in interface Authentication
      Overrides:
      getName in class AbstractAuthenticationToken
    • getCredentialId

      public byte[] getCredentialId()
      The id of the credential that signed, or null.
    • isUserVerified

      public boolean isUserVerified()
      Whether the authenticator verified the user -- a PIN, a fingerprint, a face -- so that the sign-in is two factors by itself.