搜索插件、代码仓与 APP 分类

passkeys 封面
插件详情v2.24.1

passkeys

Flutter 插件,支持简单的 passkey 身份验证。可与现成的依赖方服务器(Corbado)配合使用,也可与您自定义的依赖方配合使用。

AndroidiOSWebmacOSWindows
近 30 天下载
24.1万
喜欢数
115
Pub 分数
150

安装插件

flutter pub add passkeys

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

passkeys 包是一个 Flutter 插件,可简化在多个平台(包括 Android、iOS、Web、macOS 和 Windows)上的基于 passkey 的身份验证。它支持与 Corbado 的即用型依赖方服务器集成,或自定义依赖方实现。该插件旨在提供安全的无密码登录体验,利用平台原生的生物识别和设备身份验证机制。通过抽象复杂的加密操作,开发者可以以最少的设置实现现代身份验证流程。非常适合注重安全性和用户便利性的应用。

适合场景

  • 无密码登录
  • 生物识别认证
  • 安全应用访问
  • 跨平台身份验证
  • 与身份提供商的集成

主要特点

  • 支持 Corbado 和自定义依赖方
  • 平台原生生物识别
  • 跨平台兼容性
  • 用于密钥管理的简单 API
  • 安全凭证存储

适合对象

  • 需要强认证的应用
  • 开发无密码系统的开发者
  • 使用 Corbado 或自定义 IdP 的团队
  • 移动和桌面应用程序
  • 注重安全的应用程序

使用建议

  • 需要后端依赖方设置
  • 仅限支持的平台
  • 取决于设备生物识别功能的可用性
  • 可能需要为自定义服务器进行额外配置
  • 不适用于非生物特征环境

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

GitHub Repo Cover

Flutter passkeys

Flutter packages to enable passkey authentication (based on WebAuthn / FIDO2).

Android iOS Linux macOS Web Windows
Support :white_check_mark: :white_check_mark: :x: :white_check_mark: :white_check_mark: :white_check_mark:
passkey-signup

Current list of packages

1. Passkeys
Description

A Flutter package that enables simple passkey authentication. Currently Android, iOS, macOS, Web and Windows are supported.

Features
  • sign up and login users with passkeys
  • connect your own relying party server or use pre-implemented ones

Read more

2. Corbado Auth
Description

A Flutter package that builds on the passkeys package. It adds additional functionalities to make it simpler to use passkey authentication in your own Flutter app.

integration-guides

Features
  • sign up and login users with passkeys
  • connect Corbado as pre-implemented relying party server
  • keep users logged in even if they close the app (automatic session refresh)

Read more

3. Corbado Auth Firebase

A Flutter package that builds on the corbado_auth and the passkeys package. It helps you to integrate passkey authentication into your Flutter app that uses Firebase as a backend.

Note: This package is currently broken and will be fixed in the future. There is no specific ETA on when the fix will be available.

Features
  • allow new users to sign up and log in using passkeys
  • allow existing users (that you created with Firebase authentication) to setup a passkey and then log in with it
  • email OTP codes as fallback mechanism for situations when passkeys can not be used (e.g. when a user logs in to a device where none of his passkeys is available)

Read more

4. Supabase

The passkeys package can be used as the platform authenticator for supabase_flutter. Supabase Auth acts as the relying party server, while passkeys handles the native passkey prompts on iOS, Android, macOS, Windows and Web.

It requires supabase_flutter 2.15.0 or later and passkeys 2.21.0 or later.

Setup

Add both packages to your pubspec.yaml:

dependencies:
  supabase_flutter: ^2.15.0
  passkeys: ^2.21.0

Initialize Supabase as usual and create a PasskeyAuthenticator that you pass to the passkey methods:

import 'package:passkeys/authenticator.dart';
import 'package:supabase_flutter/supabase_flutter.dart';

await Supabase.initialize(
  url: supabaseUrl,
  anonKey: supabaseAnonKey,
);

final supabase = Supabase.instance.client;
final authenticator = PasskeyAuthenticator();
Registering a passkey

Registering a passkey requires a signed in (non-anonymous) user. It adds a passkey to the current account:

try {
  final passkey = await supabase.auth.registerPasskey(authenticator);
  print('Registered passkey ${passkey.id}');
} on AuthException catch (e) {
  print(e);
}
Signing in with a passkey
try {
  final res = await supabase.auth.signInWithPasskey(authenticator);
  print('Signed in as ${res.user?.email}');
} on AuthException catch (e) {
  print(e);
}

For custom flows there is also a two-step API under the supabase.auth.passkey namespace (startRegistration/verifyRegistration and startAuthentication/verifyAuthentication), as well as methods to list, rename and delete passkeys.

For the full guide and configuration steps, see the Supabase passkeys documentation.

Contributing

We're happy to receive your pull requests. For major changes, please open an issue first to discuss what you would like to change.

Support

If you have questions, feedback or wishes regarding features, please reach out to us via [email](mailto:contact@corbado.com) or join our passkeys community on Slack.

License

BSD-3-clause

所属分类

依赖

依赖清单 8 项

源码仓库

使用此插件的项目