认证与权限安全
你当前正在浏览历史版本 Vert.x 4.0.3 的文档。 前往 最新版本文档首页。

WebAuthn / FIDO2 生物认证与安全密钥提供者

本模块提供了基于 FIDO2 / WebAuthn 标准协议的无密与生物识别身份认证支持。

用户可以使用支持 FIDO2 的物理硬件安全密钥(如 YubiKey)、TouchID/FaceID 等平台认证器进行安全登录。

依赖引入

  • Maven (pom.xml):

<dependency>
 <groupId>io.vertx</groupId>
 <artifactId>vertx-auth-webauthn</artifactId>
 <version>4.5.35</version>
</dependency>

快速开始

配置 WebAuthn 选项与凭证存储:

WebAuthnOptions options = new WebAuthnOptions()
  .setRelyingParty(new RelyingParty().setName("ACME Corp"))
  .setUserVerification(UserVerification.PREFERRED);

WebAuthn webAuthn = WebAuthn.create(vertx, options, databaseCredentialsStore);