Update/passkey 01 - #13378
Update/passkey 01#13378rastislavcore wants to merge 4 commits into
Conversation
Updates `@simplewebauthn/browser` and `@simplewebauthn/server` dependencies to v13.2.2. This upgrade brings improved security and compatibility by aligning with the latest version of the library, addressing potential vulnerabilities and ensuring better integration with modern browser environments. It also changes the way options are passed to `startAuthentication` and `startRegistration` methods. The userID for registration options is now expected to be a Uint8Array. The authenticator's credential ID is no longer base64 encoded.
Updates the WebAuthn verification process to align with changes in the underlying SimpleWebAuthn library. This change streamlines the extraction and usage of credential information, resulting in a cleaner and more maintainable codebase. It simplifies the verification logic by directly passing credential data.
Updates the WebAuthn and Passkey provider documentation to reflect the SimpleWebAuthn v13 API changes. This includes clarifying the required peer dependencies, detailing the differences in the API (credential IDs as base64 strings, `verifyAuthenticationResponse` requiring a `credential` object, and the options shape for browser helpers), and updating the setup instructions accordingly. This ensures developers using these providers with SimpleWebAuthn v13 have accurate and up-to-date information.
Updates the `@simplewebauthn/browser` and `@simplewebauthn/server` peer dependencies to version 13.2.2 in the WebAuthn and Passkey documentation. Clarifies the usage of `@simplewebauthn/browser` dependency, emphasizing that it's only required for custom sign-in pages. Also, mentions that types are now exported from browser and server packages.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
@rastislavcore is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
|
Thanks for this migration, @rastislavcore. I rebased your four commits onto current One thing that PR fixes: Auth.js stores credential IDs as standard base64 and normalises the browser's ID to that before |
☕️ Reasoning
This PR upgrades WebAuthn / Passkey support to SimpleWebAuthn v13 and keeps docs and tests in sync.
This will make it production ready instead of deprecated version.
Package updates
API and implementation changes (v13)
userIDis now aUint8Array(encoded viaTextEncoder); credential IDs inallowCredentials/excludeCredentialsare base64 strings (a.credentialID).credential(WebAuthnCredential:id,publicKey,counter) instead ofauthenticator. AddadapterAuthenticatorToWebAuthnCredential()and ensurepublicKeyis anArrayBuffer-backedUint8Arrayfor type compatibility.registrationInfoshape:credential(id, publicKey, counter) and top-levelcredentialDeviceType/credentialBackedUp.webauthn-client.js):startAuthenticationandstartRegistrationnow take a single options object (optionsJSON,useBrowserAutofill/useAutoRegister).ConfigurableVerifyAuthenticationOptionsomitscredentialinstead ofauthenticator. Remove unusedfromAdapterAuthenticator.Tests
registrationInfo.credential,credentialin auth verification,CredentialDeviceType,Uint8ArrayforpublicKey).provider.id === "passkey".Documentation
passkey.ts,webauthn.ts): document both peer deps, v13.2.2 install, and a short “SimpleWebAuthn v13” note (credential IDs,credentialusage, browser API shape).docs/pages/getting-started/providers/passkey.mdxanddocs/pages/getting-started/authentication/webauthn.mdxto install@^13.2.2, mention v13 and that types live in browser/server. Fix typo@simplewebauth/browser→@simplewebauthn/browser.🧢 Checklist
🎫 Affected issues
📌 Resources