-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate registration options #4
base: main
Are you sure you want to change the base?
Conversation
Tests are broken because of an issue with module resolution in @cloudflare/vitest-pool-workers. They don't like imports of folders with an index.js file (e.g. errors/index.js) as See here: cloudflare/workers-sdk#6286 (comment) What's annoying is that the code is otherwise fine - it executes as expected when hitting http://localhost:8787/registration/options. It's only the testing environment that's having problems 😞 |
Oh nice upgrading @cloudflare/[email protected] fixed the tests 🎉 |
@timcappalli I'm curious what you think about this as a direction for the API to go. I basically modeled it after what's on https://webauthn.io. There's still some things missing (sessions to store challenges for, persistence of challenges, etc...) but I want to make sure this is good so far before I merge it and move on. |
const opts = await generateRegistrationOptions({ | ||
rpID: RP_ID, | ||
rpName: RP_NAME, | ||
userName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userName, | |
userName: username, |
This threw me being case sensitive and wasn't expecting a capital N
This PR fleshes out the
GET /registration/options
endpoint to support the following options as query params:userName
(Required): StringuserID
(Optional): base64url string of bytes (defaults to random ID generated by SimpleWebAuthn)userVerification
(Optional): Either'discouraged'
,'preferred'
, or'required'
(defaults to'preferred'
)attestation
(Optional): Either'none'
or'direct'
(defaults to'none'
)attachment
(Optional): Either'cross-platform'
or'platform'
algES256
(Optional): Boolean (defaults totrue
)algRS256
(Optional): Boolean (defaults totrue
)discoverableCredential
(Optional): Either'discouraged'
,'preferred'
, or'required'
(defaults to'required'
)