feat: add prf support#37
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates WebAuthn passkey registration option generation to request the PRF extension and to require resident (discoverable) credentials, covering both the shared WebAuthn config helper and the admin registration options endpoint.
Changes:
- Tighten WebAuthn
authenticatorSelectionto require resident keys (residentKey: "required"+requireResidentKey: true). - Add
extensions: { prf: {} }to registration options to enable PRF negotiation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/webauthn/config.ts | Updates shared passkey registration options to require resident keys and request PRF extension. |
| app/api/admin/passkey/register/options/route.ts | Mirrors the same resident-key requirement and PRF extension in the admin registration options endpoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
24
to
27
| authenticatorSelection: { | ||
| residentKey: "preferred", | ||
| residentKey: "required", | ||
| requireResidentKey: true, | ||
| userVerification: "preferred", |
Comment on lines
51
to
+60
| authenticatorSelection: { | ||
| residentKey: "preferred", | ||
| residentKey: "required", | ||
| requireResidentKey: true, | ||
| userVerification: "preferred", | ||
| authenticatorAttachment: "platform", | ||
| }, | ||
| supportedAlgorithmIDs: [-7, -257], // ES256, RS256 | ||
| extensions: { prf: {} } as Parameters< | ||
| typeof generateRegistrationOptions | ||
| >[0]["extensions"], |
Comment on lines
+34
to
35
| extensions: { prf: {} } as GenerateRegistrationOptionsOpts["extensions"], | ||
| }; |
Comment on lines
+31
to
35
| // PRF extension isn't in @simplewebauthn's DOM types yet, but is passed | ||
| // through to the client and enables HKDF-based symmetric key derivation | ||
| // at authentication time (e.g. for E2EE key wrapping). | ||
| extensions: { prf: {} } as GenerateRegistrationOptionsOpts["extensions"], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.