Package io.quarkus.security.webauthn
Class WebAuthnSecurity
java.lang.Object
io.quarkus.security.webauthn.WebAuthnSecurity
Utility class that allows users to manually login or register users using WebAuthn
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebAuthnSecurity
(WebAuthnRunTimeConfig config, io.vertx.core.Vertx vertx, WebAuthnAuthenticatorStorage database) -
Method Summary
Modifier and TypeMethodDescriptionio.vertx.ext.auth.webauthn.WebAuthn
Returns the underlying Vert.x WebAuthn authenticatorio.smallrye.mutiny.Uni<io.vertx.ext.auth.webauthn.Authenticator>
login
(WebAuthnLoginResponse response, io.vertx.ext.web.RoutingContext ctx) Logs an existing WebAuthn user invoid
logout
(io.vertx.ext.web.RoutingContext ctx) Clears the login cookie on the current requestio.smallrye.mutiny.Uni<io.vertx.ext.auth.webauthn.Authenticator>
register
(WebAuthnRegisterResponse response, io.vertx.ext.web.RoutingContext ctx) Registers a new WebAuthn credentialsvoid
rememberUser
(String userID, io.vertx.ext.web.RoutingContext ctx) Adds a login cookie to the current request for the given user ID(package private) static void
removeCookie
(io.vertx.ext.web.RoutingContext ctx, String name)
-
Field Details
-
authMech
-
-
Constructor Details
-
WebAuthnSecurity
public WebAuthnSecurity(WebAuthnRunTimeConfig config, io.vertx.core.Vertx vertx, WebAuthnAuthenticatorStorage database)
-
-
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 infoctx
- 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 infoctx
- the current request- Returns:
- the updated credentials
-
removeCookie
-
getWebAuthn
public io.vertx.ext.auth.webauthn.WebAuthn getWebAuthn()Returns the underlying Vert.x WebAuthn authenticator- Returns:
- the underlying Vert.x WebAuthn authenticator
-
rememberUser
Adds a login cookie to the current request for the given user ID- Parameters:
userID
- the user ID to use asPrincipal
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
-