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

Add Passkeys SDK UI Recipe and Page #161

Merged
merged 3 commits into from
Dec 11, 2023
Merged

Conversation

ollie-stytch
Copy link
Contributor

@ollie-stytch ollie-stytch commented Nov 30, 2023

Screenshot 2023-11-30 at 2 11 07 PM Screenshot 2023-11-30 at 2 13 56 PM Screenshot 2023-11-30 at 2 11 59 PM Screenshot 2023-11-30 at 2 12 32 PM

MFA Screen:
Screenshot 2023-11-30 at 2 13 12 PM

Copy link

vercel bot commented Nov 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stytch-nextjs-integration ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2023 3:14pm

@ollie-stytch ollie-stytch changed the title [AUTH-2181] Add Passkeys SDK UI Recipe and Page Add Passkeys SDK UI Recipe and Page Nov 30, 2023
@chris-stytch
Copy link
Contributor

I got stuck in a few different places, I'll try to detail each flow.

Existing user "[email protected]"

[email protected] is an existing user within the Stytch Demo Project, I performed email OTP and then dropped into this pane:
image

Clicking the button there resulted in this error request-id-test-e1d66627-a6ab-4620-b5f9-e0217d354f01:
image

New user "[email protected]"

Figuring that the existing user state might be wonky (I previously had WebAuthn registrations), I tried a new user. When going through that flow I was able to register the Passkey, but after registering, clicking Continue dropped me back on to the "Register Passkey" button pane:
image

Trying to register again resulted in this duplicate Passkeys error (from Apple):
image

I see the Passkey on my User object, so potentially that is the expected state? i.e. there is no error, the flow just ends there? If so I'd just suggest adding some more copy to the Profile page or a second button "Authenticate Passkey" to make it more clear that after you register, you are done with the flow and can now authenticate with that registered Passkey.

@ollie-stytch
Copy link
Contributor Author

ollie-stytch commented Dec 2, 2023

@chris-stytch
To address point 2 I added a success view at the end of the flow:
Screenshot 2023-12-02 at 3 13 51 PM

As for the existing user problem what I think happened is the following:

  1. [email protected] links an email on stytchdemo.com
  2. [email protected] registers a webauthn reg tied to stytchdemo.com
  3. [email protected] goes to login to localhost:3000 and logs in with otp
  4. [email protected] is prompted to step up because some registrations do exist for the user, although no registrations exist on this domain for this user.
  5. Error when trying to authenticate since no webauthn reg exists on this domain.

Unfortunately I don't know what we can do about this right now. In the future we may be able to make MFA consider domain but as of now this is the state of things.

@chris-stytch
Copy link
Contributor

Gotcha, I figured it might be a thorny user state issue. In fairness, my default email has been put through the wringer in this demo project.

@ollie-stytch ollie-stytch merged commit 6b660e5 into main Dec 11, 2023
4 checks passed
@ollie-stytch ollie-stytch deleted the ollie/passkeys-sdk-ui branch December 11, 2023 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants