[PR #1318] [MERGED] feat: passkey plugin with client-side authenticatorAttachment and global authenticatorSelection configuration #11998

Closed
opened 2026-04-13 08:07:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1318
Author: @benbehringer
Created: 1/30/2025
Status: Merged
Merged: 2/28/2025
Merged by: @Bekacru

Base: mainHead: feature/passkey-authenticator-attachments


📝 Commits (10+)

  • 6a24e45 feat(passkey): Add authenticator attachment options and global configuration
  • 84bc480 docs(passkey: adding documentation for new configuration options
  • 65a3580 fix(passkey): omit undefined authenticatorAttachment query param
  • ab0fbc4 fix(passkey): remove commented-out code in passkey documentation
  • d54bc25 Merge branch 'main' into feature/passkey-authenticator-attachments
  • 27b9c25 chore: lint
  • b1baa72 Merge branch 'main' into feat/passkey-authenticator
  • 2fe8a01 update js doc
  • 3dda877 Merge branch 'main' into feat/passkey-authenticator
  • 816460b fix(passkey): make query parameter optional and safely access authenticator attachment

📊 Changes

3 files changed (+75 additions, -3 deletions)

View changed files

📝 docs/content/docs/plugins/passkey.mdx (+32 -1)
📝 packages/better-auth/src/plugins/passkey/client.ts (+12 -0)
📝 packages/better-auth/src/plugins/passkey/index.ts (+31 -2)

📄 Description

Description

This PR addresses Issue #1311 by enhancing the Passkey plugin in better-auth to allow clients to specify the authenticatorAttachment (platform or cross-platform) during passkey registration. Additionally, it introduces a global authenticatorSelection configuration to enforce server-side policies for residentKey and userVerification.

Changes

  • Client-Side authenticatorAttachment Option:

    • Enables specifying 'platform' or 'cross-platform' during passkey registration.
  • Global authenticatorSelection Configuration:

    • Adds global settings for residentKey and userVerification to enforce server-side policies.
  • TypeScript and API Updates:

    • Updated TypeScript types and API endpoints to support new options.
  • Backward Compatibility:

    • Maintained existing functionality with default settings for existing implementations.
  • Documentation:

    • Added guides for global and client-side settings.

Testing

Register Passkey:

  • Test with different authenticatorAttachment options and authenticatorSelection.

Related Issue


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/1318 **Author:** [@benbehringer](https://github.com/benbehringer) **Created:** 1/30/2025 **Status:** ✅ Merged **Merged:** 2/28/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `feature/passkey-authenticator-attachments` --- ### 📝 Commits (10+) - [`6a24e45`](https://github.com/better-auth/better-auth/commit/6a24e457549bede58bc495487d511ddf61809a9c) feat(passkey): Add authenticator attachment options and global configuration - [`84bc480`](https://github.com/better-auth/better-auth/commit/84bc480a6a7009de97d56c0fccfbe1b50b3abd90) docs(passkey: adding documentation for new configuration options - [`65a3580`](https://github.com/better-auth/better-auth/commit/65a35806a70eece861a5edb33a1f99dcf2e5ee13) fix(passkey): omit undefined authenticatorAttachment query param - [`ab0fbc4`](https://github.com/better-auth/better-auth/commit/ab0fbc4ca8ede9e4636422862378acf9224b7d37) fix(passkey): remove commented-out code in passkey documentation - [`d54bc25`](https://github.com/better-auth/better-auth/commit/d54bc258036af37aabdac2f075116ed4d61d8d14) Merge branch 'main' into feature/passkey-authenticator-attachments - [`27b9c25`](https://github.com/better-auth/better-auth/commit/27b9c25aa08cf06b1713fd90221b777efa707c02) chore: lint - [`b1baa72`](https://github.com/better-auth/better-auth/commit/b1baa72edfc143d4e6430a7219cf3605478e2f68) Merge branch 'main' into feat/passkey-authenticator - [`2fe8a01`](https://github.com/better-auth/better-auth/commit/2fe8a01a260f83f54706ce2dcd35bd37f7fb556f) update js doc - [`3dda877`](https://github.com/better-auth/better-auth/commit/3dda877f224d71d018db684f1411d81851ba68f9) Merge branch 'main' into feat/passkey-authenticator - [`816460b`](https://github.com/better-auth/better-auth/commit/816460b1591331b28065c6ace5925a62d9c53a7d) fix(passkey): make query parameter optional and safely access authenticator attachment ### 📊 Changes **3 files changed** (+75 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/plugins/passkey.mdx` (+32 -1) 📝 `packages/better-auth/src/plugins/passkey/client.ts` (+12 -0) 📝 `packages/better-auth/src/plugins/passkey/index.ts` (+31 -2) </details> ### 📄 Description **Description** This PR addresses **Issue #1311** by enhancing the Passkey plugin in `better-auth` to allow clients to specify the `authenticatorAttachment` (`platform` or `cross-platform`) during passkey registration. Additionally, it introduces a global `authenticatorSelection` configuration to enforce server-side policies for `residentKey` and `userVerification`. **Changes** - **Client-Side `authenticatorAttachment` Option:** - Enables specifying `'platform'` or `'cross-platform'` during passkey registration. - **Global `authenticatorSelection` Configuration:** - Adds global settings for `residentKey` and `userVerification` to enforce server-side policies. - **TypeScript and API Updates:** - Updated TypeScript types and API endpoints to support new options. - **Backward Compatibility:** - Maintained existing functionality with default settings for existing implementations. - **Documentation:** - Added guides for global and client-side settings. **Testing** **Register Passkey:** - Test with different `authenticatorAttachment` options and `authenticatorSelection`. **Related Issue** - Addresses #1311 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 08:07:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#11998