Class WebAuthnSecurity

java.lang.Object
io.quarkus.security.webauthn.WebAuthnSecurity

@ApplicationScoped public class WebAuthnSecurity extends Object
Utility class that allows users to manually login or register users using WebAuthn
  • Field Details

  • Constructor Details

  • Method Details

    • register

      public io.smallrye.mutiny.Uni<io.vertx.ext.auth.webauthn.Authenticator> register(WebAuthnRegisterResponse response, io.vertx.ext.web.RoutingContext ctx)
      Registers a new WebAuthn credentials
      Parameters:
      response - the Webauthn registration info
      ctx - the current request
      Returns:
      the newly created credentials
    • login

      public io.smallrye.mutiny.Uni<io.vertx.ext.auth.webauthn.Authenticator> login(WebAuthnLoginResponse response, io.vertx.ext.web.RoutingContext ctx)
      Logs an existing WebAuthn user in
      Parameters:
      response - the Webauthn login info
      ctx - the current request
      Returns:
      the updated credentials
    • removeCookie

      static void removeCookie(io.vertx.ext.web.RoutingContext ctx, String name)
    • getWebAuthn

      public io.vertx.ext.auth.webauthn.WebAuthn getWebAuthn()
      Returns the underlying Vert.x WebAuthn authenticator
      Returns:
      the underlying Vert.x WebAuthn authenticator
    • rememberUser

      public void rememberUser(String userID, io.vertx.ext.web.RoutingContext ctx)
      Adds a login cookie to the current request for the given user ID
      Parameters:
      userID - the user ID to use as Principal
      ctx - the current request, in order to add a cookie
    • logout

      public void logout(io.vertx.ext.web.RoutingContext ctx)
      Clears the login cookie on the current request
      Parameters:
      ctx - the current request, in order to clear the login cookie