Class WebAuthnAuthenticationContext

All Implemented Interfaces:
Iterable<BaseContext>

@NotThreadSafe public final class WebAuthnAuthenticationContext extends BaseWebAuthnContext
Authentication context for processing WebAuthn authentication ceremonies.
  • Field Details

    • credentialId

      @Nullable private byte[] credentialId
      The credential identifier generated by the authenticator.
    • secondFactor

      private boolean secondFactor
      Are we operating as a second factor of authentication?
    • passwordless

      private boolean passwordless
      Are we operating in passwordless mode.
    • usernameless

      private boolean usernameless
      Are we operating in usernameless mode.
    • publicKeyCredentialAssertionResponse

      @Nullable private com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAssertionResponse,com.yubico.webauthn.data.ClientAssertionExtensionOutputs> publicKeyCredentialAssertionResponse
      A public key credential with assertion response that is the result of authentication.
    • publicKeyCredentialRequestOptions

      @Nullable private com.yubico.webauthn.data.PublicKeyCredentialRequestOptions publicKeyCredentialRequestOptions
      The public key credential request options for generating an authentication assertion.
  • Constructor Details

    • WebAuthnAuthenticationContext

      public WebAuthnAuthenticationContext()
  • Method Details

    • getCredentialId

      public byte[] getCredentialId()
      Get the credential Id.
      Returns:
      the credential Id.
    • setCredentialId

      public WebAuthnAuthenticationContext setCredentialId(@Nonnull byte[] id)
      Set the credential Id.
      Parameters:
      id - the credential Id.
      Returns:
      this context
    • setPublicKeyCredentialRequestOptions

      @Nonnull public WebAuthnAuthenticationContext setPublicKeyCredentialRequestOptions(@Nullable com.yubico.webauthn.data.PublicKeyCredentialRequestOptions options)
      Set the public key credential request options for generating an authentication assertion.
      Parameters:
      options - the request options to set.
      Returns:
      this context
    • getPublicKeyCredentialRequestOptions

      @Nullable public com.yubico.webauthn.data.PublicKeyCredentialRequestOptions getPublicKeyCredentialRequestOptions()
      Get the public key credential request options for generating an authentication assertion.
      Returns:
      the public key credential request options.
    • setPublicKeyCredentialAssertionResponse

      @Nonnull public WebAuthnAuthenticationContext setPublicKeyCredentialAssertionResponse(@Nullable com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAssertionResponse,com.yubico.webauthn.data.ClientAssertionExtensionOutputs> pkCredAssertion)
      Set the raw public key credential with authenticator assertion response, returned after the authentication ceremony.
      Parameters:
      pkCredAssertion - The public key credential containing an authenticator assertion response to set.
      Returns:
      this context
    • getPublicKeyCredentialAssertionResponse

      @Nullable public com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAssertionResponse,com.yubico.webauthn.data.ClientAssertionExtensionOutputs> getPublicKeyCredentialAssertionResponse()
      Get the public key credential with authenticator assertion response, from the authentication ceremony.
      Returns:
      the public key credential with authenticator a assertion response.
    • setUsernameless

      @Nonnull public WebAuthnAuthenticationContext setUsernameless(boolean flag)
      Set if this authentication is part of a usernameless flow/mode.
      Parameters:
      flag - the flag to indicate the mode of authentication
      Returns:
      this context
    • isUsernameless

      public boolean isUsernameless()
      Is this authentication part of a usernameless flow/mode?
      Returns:
      true if it is, false otherwise.
    • setPasswordless

      @Nonnull public WebAuthnAuthenticationContext setPasswordless(boolean flag)
      Set if this authentication is part of a passwordless flow/mode.
      Parameters:
      flag - the flag to indicate the mode of authentication
      Returns:
      this context
    • isPasswordless

      public boolean isPasswordless()
      Is this authentication part of a passwordless flow/mode.
      Returns:
      true if it is, false otherwise.
    • setSecondFactor

      @Nonnull public WebAuthnAuthenticationContext setSecondFactor(boolean flag)
      Set if this authentication is part of a second factor flow/mode.
      Parameters:
      flag - the flag to indicate the mode of authentication.
      Returns:
      this context
    • isSecondFactor

      public boolean isSecondFactor()
      Is this authentication part of a second factor flow/mode?
      Returns:
      true if it is, false otherwise.