Package io.quarkus.security.webauthn
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 Summary
Fields Modifier and Type Field Description (package private) WebAuthnAuthenticationMechanismauthMech
-
Constructor Summary
Constructors Constructor Description WebAuthnSecurity(WebAuthnRunTimeConfig config, io.vertx.core.Vertx vertx, WebAuthnAuthenticatorStorage database)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.vertx.ext.auth.webauthn.WebAuthngetWebAuthn()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 invoidlogout(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 credentialsvoidrememberUser(String userID, io.vertx.ext.web.RoutingContext ctx)Adds a login cookie to the current request for the given user ID(package private) static voidremoveCookie(io.vertx.ext.web.RoutingContext ctx, String name)
-
-
-
Field Detail
-
authMech
@Inject WebAuthnAuthenticationMechanism authMech
-
-
Constructor Detail
-
WebAuthnSecurity
public WebAuthnSecurity(WebAuthnRunTimeConfig config, io.vertx.core.Vertx vertx, WebAuthnAuthenticatorStorage database)
-
-
Method Detail
-
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
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 asPrincipalctx- 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
-
-