Class WebAuthnAuthenticator

java.lang.Object
org.keycloak.authentication.authenticators.browser.WebAuthnAuthenticator
All Implemented Interfaces:
org.keycloak.authentication.Authenticator, org.keycloak.authentication.CredentialValidator<WebAuthnCredentialProvider>, org.keycloak.provider.Provider
Direct Known Subclasses:
WebAuthnPasswordlessAuthenticator

public class WebAuthnAuthenticator extends Object implements org.keycloak.authentication.Authenticator, org.keycloak.authentication.CredentialValidator<WebAuthnCredentialProvider>
Authenticator for WebAuthn authentication, which will be typically used when WebAuthn is used as second factor.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.keycloak.models.KeycloakSession
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebAuthnAuthenticator(org.keycloak.models.KeycloakSession session)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    action(org.keycloak.authentication.AuthenticationFlowContext context)
     
    void
    authenticate(org.keycloak.authentication.AuthenticationFlowContext context)
     
    void
     
    boolean
    configuredFor(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user)
     
    protected jakarta.ws.rs.core.Response
    createErrorResponse(org.keycloak.authentication.AuthenticationFlowContext context, String errorCase)
     
    org.keycloak.forms.login.LoginFormsProvider
    fillContextForm(org.keycloak.authentication.AuthenticationFlowContext context)
     
    getCredentialProvider(org.keycloak.models.KeycloakSession session)
     
    protected String
     
    List<org.keycloak.authentication.RequiredActionFactory>
    getRequiredActions(org.keycloak.models.KeycloakSession session)
     
    protected String
    getRpID(org.keycloak.authentication.AuthenticationFlowContext context)
     
    protected org.keycloak.models.WebAuthnPolicy
    getWebAuthnPolicy(org.keycloak.authentication.AuthenticationFlowContext context)
     
    boolean
     
    protected void
    setErrorResponse(org.keycloak.authentication.AuthenticationFlowContext context, String errorCase, String errorMessage)
     
    void
    setRequiredActions(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user)
     
    protected boolean
    shouldDisplayAuthenticators(org.keycloak.authentication.AuthenticationFlowContext context)
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.keycloak.authentication.Authenticator

    areRequiredActionsEnabled

    Methods inherited from interface org.keycloak.authentication.CredentialValidator

    getCredentials, getType
  • Field Details

    • session

      protected final org.keycloak.models.KeycloakSession session
  • Constructor Details

    • WebAuthnAuthenticator

      public WebAuthnAuthenticator(org.keycloak.models.KeycloakSession session)
  • Method Details

    • authenticate

      public void authenticate(org.keycloak.authentication.AuthenticationFlowContext context)
      Specified by:
      authenticate in interface org.keycloak.authentication.Authenticator
    • fillContextForm

      public org.keycloak.forms.login.LoginFormsProvider fillContextForm(org.keycloak.authentication.AuthenticationFlowContext context)
    • getWebAuthnPolicy

      protected org.keycloak.models.WebAuthnPolicy getWebAuthnPolicy(org.keycloak.authentication.AuthenticationFlowContext context)
    • getRpID

      protected String getRpID(org.keycloak.authentication.AuthenticationFlowContext context)
    • getCredentialType

      protected String getCredentialType()
    • shouldDisplayAuthenticators

      protected boolean shouldDisplayAuthenticators(org.keycloak.authentication.AuthenticationFlowContext context)
    • action

      public void action(org.keycloak.authentication.AuthenticationFlowContext context)
      Specified by:
      action in interface org.keycloak.authentication.Authenticator
    • requiresUser

      public boolean requiresUser()
      Specified by:
      requiresUser in interface org.keycloak.authentication.Authenticator
    • configuredFor

      public boolean configuredFor(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user)
      Specified by:
      configuredFor in interface org.keycloak.authentication.Authenticator
    • setRequiredActions

      public void setRequiredActions(org.keycloak.models.KeycloakSession session, org.keycloak.models.RealmModel realm, org.keycloak.models.UserModel user)
      Specified by:
      setRequiredActions in interface org.keycloak.authentication.Authenticator
    • getRequiredActions

      public List<org.keycloak.authentication.RequiredActionFactory> getRequiredActions(org.keycloak.models.KeycloakSession session)
      Specified by:
      getRequiredActions in interface org.keycloak.authentication.Authenticator
    • close

      public void close()
      Specified by:
      close in interface org.keycloak.provider.Provider
    • getCredentialProvider

      public WebAuthnCredentialProvider getCredentialProvider(org.keycloak.models.KeycloakSession session)
      Specified by:
      getCredentialProvider in interface org.keycloak.authentication.CredentialValidator<WebAuthnCredentialProvider>
    • setErrorResponse

      protected void setErrorResponse(org.keycloak.authentication.AuthenticationFlowContext context, String errorCase, String errorMessage)
    • createErrorResponse

      protected jakarta.ws.rs.core.Response createErrorResponse(org.keycloak.authentication.AuthenticationFlowContext context, String errorCase)