Skip to content
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

DEV: Refactor webauthn to support passkeys (1/3) #23586

Merged
merged 4 commits into from Oct 3, 2023
Merged

Conversation

pmusaraj
Copy link
Contributor

@pmusaraj pmusaraj commented Sep 14, 2023

This is part 1 of 3, split up of PR #23529. This PR refactors the webauthn code to support passkey authentication/registration.

Passkeys aren't used yet, that is coming in PRs 2 and 3.

Changes in this PR include:

  • renaming webauthn services
  • centralizing rp_id and origin properties (this also simplifies local testing)
  • adding first factor params to webauthn services
  • adding specs with valid credentials for first factor

This is part 1 of 3, split up of PR #23529. This PR refactors the
webauthn code to support passkey authentication/registration.

Passkeys aren't used yet, that is coming in PRs 2 and 3.
# bit 6 - attested credential data
# bit 7 - extension data

def validate_user_presence
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, we were checking for the user presence flag only but the validation was using the wrong name. The change here adds the correct error message for user presence and adds the correct flow for user verification. (Note that in the registration/authentication services, verification is only used for first-factor keys.)

@pmusaraj pmusaraj changed the title DEV: Refactor webauthn to support passkeys DEV: Refactor webauthn to support passkeys (1/3) Sep 14, 2023
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/support-for-apples-passkeys-system/229259/32

@pmusaraj pmusaraj marked this pull request as ready for review September 27, 2023 20:00
@pmusaraj
Copy link
Contributor Author

Marked this as ready for review just now, if you have a chance to review please @tgxworld @davidtaylorhq.

app/models/user.rb Outdated Show resolved Hide resolved
lib/discourse_webauthn.rb Outdated Show resolved Hide resolved
pmusaraj and others added 2 commits September 28, 2023 11:14
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
app/models/user.rb Outdated Show resolved Hide resolved
app/models/user.rb Outdated Show resolved Hide resolved
Copy link
Contributor

@tgxworld tgxworld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more small comments that needs to be resolved but I think the changes look great to me 👍

@pmusaraj pmusaraj merged commit 0af6c5e into main Oct 3, 2023
17 checks passed
@pmusaraj pmusaraj deleted the passkeys-part-1 branch October 3, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants