Class WebAuthnCredential

java.lang.Object
io.hanko.sdk.webauthn.api.WebAuthnCredential

public class WebAuthnCredential extends Object
Representation of a credential.
  • Constructor Details

    • WebAuthnCredential

      public WebAuthnCredential(String id, User user, String createdAt, String lastUsed, boolean isResidentKey, String name, boolean userVerification, Authenticator authenticator)
      Construct a WebAuthnCredential.

      Generally, there is no need for SDK clients to ever manually instantiate WebAuthnCredentials since they are part of Hanko API responses that are deserialized through the SDK.

      Parameters:
      id - the id of the credential
      user - the user associated with the credential
      createdAt - the time of creation of the credential
      lastUsed - the last usage time for authentication
      isResidentKey - whether this credential is a resident key credential
      userVerification - whether this credential was registered with user verification
      name - the name of the credential
      authenticator - the authenticator used for registration
  • Method Details

    • getId

      public String getId()
      Get the credential ID
      Returns:
      the ID of the credential as a String
    • getUser

      public User getUser()
      Get the User associated with the credential.
      Returns:
      the user who registered the credential
    • getCreatedAt

      public String getCreatedAt()
      Get the time of credential creation.
      Returns:
      the time of credential creation in date-time notation as defined by RFC 3339, section 5.6
    • getLastUsed

      public String getLastUsed()
      Get the last time this credential was used for authentication
      Returns:
      the last usage in date-time notation as defined by RFC 3339, section 5.6
    • isResidentKey

      public boolean isResidentKey()
      Indicates whether this credential was registered as a resident credential/client-side discoverable credential
      Returns:
      true if it was registered as a resident credential, false otherwise
    • getName

      public String getName()
      Get the name for the credential. The name has a default value on credential creation but can be changed later through the update credential operation.
      Returns:
      the name as a String
    • isUserVerification

      public boolean isUserVerification()
      Indicates whether this credential was registered with a successful user verification process.
      Returns:
      true if the credential was registered with user verification, false otherwise
    • getAuthenticator

      public Authenticator getAuthenticator()
      Get the Authenticator used for registering the credential.
      Returns:
      the Authenticator