near / near-api-js

JavaScript library to interact with NEAR Protocol via RPC API
https://near.github.io/near-api-js
MIT License
388 stars 240 forks source link

Passkeys/webauthn popup not triggering in Chrome #1335

Closed alenNBH closed 2 months ago

alenNBH commented 3 months ago

Prerequisites

Description

During the setup of FastAuth after complete configuration when landing on the Cloud Run application URL from received sign email during registration, the passkey/webauthn popup doesn't show in Chrome. It works in Safari.

Reproducible demo

No response

Steps to reproduce

  1. Follow the documentation for FastAuth: https://docs.near.org/tools/fastauth-sdk
  2. Create a minimal reproducible frontend application.
  3. Trigger registration of user on testnet.
  4. Receive signin email.
  5. Click on the link.
  6. Wait for timeout (there is no prompt for creating passkey)sign in

Expected behavior

Show passkey popup for creating passkey for user Screenshot 2024-04-08 at 20 04 49

Actual behavior

Timing out without any errors or logs Screenshot 2024-04-08 at 20 05 07

Your environment

Self-service

hcho112 commented 3 months ago

@alenNBH thank you for your report. First of all, is it possible if you could push your project to github and share in here? (this may speed up the process)

Otherwise, would I be able to get more info on your environment?

  1. What OS are you using? (more specific, better it is)
  2. Are you using any password manager? (1Password, Lastpass etc) If so, which one are you using?
  3. Have you tried on Chrome Cognito? (with all extensions off)
  4. Any meaningful error message on developer console? (would you be able to repeat and share the screenshot?)

Once I get these details, I can do a further investigation.

alenNBH commented 3 months ago

Hi @hcho112,

I can actually recreate the issue by going directly to signer app that is on this link: https://fast-auth-sdk-frontend-xbgueyzluq-uc.a.run.app/create-account After I fill the registration form and receive the sign in email, I open the link in email and it times out after that.

  1. Screenshot 2024-04-09 at 11 58 12

  2. No
  3. Yes, I can reproduce it in incognito as well
  4. This are the only logs in the console: Screenshot 2024-04-09 at 11 59 11
hcho112 commented 3 months ago
image

I'm using M1 mac with chrome to replicate above issue. (I don't have a machine that matches exact above sepc) But I got error on /new_account endpoint with error 401 Unauthorized. (can you also confirm that you got status 200 for this endpoint?)

alenNBH commented 3 months ago

On which page/URL and step are you getting that? I don't see that endpoint when trying to get the passkey popup to show on Chrome or Safari.

hcho112 commented 2 months ago

I was using https://fast-auth-sdk-frontend-xbgueyzluq-uc.a.run.app/create-account and attempt to create an account

hcho112 commented 2 months ago

Have you got whitelisted from our mpc recovery service?

Also, if you don't mind, can you try with latest macOS? Since I don't have access to intel Mac machine, its difficult to replicate on my end

alenNBH commented 2 months ago

For MPC recovery I'm still waiting for a ticket to be resolved here: https://github.com/near/mpc-recovery/issues/563 On my side, in Chrome, I don't even get to that point where it pings /new_account endpoint. To be fair it gets to that step when going through Safari but it doesn't get to it on Chrome. I will update the OS today and try to record a video of the process so that I can show it to you.

vikinatora commented 2 months ago

I just tried using the url @alenNBH provided and it didn't work out. In my opinion something is wrong with the source code as my MacBook M2 doesn't have issues creating biometric key pairs.

alenNBH commented 2 months ago

Hi all, I have now tried to recreate the issue with the updated OS version and it finally showed me the popup for the passkey in Chrome. The only thing is that I guess it works only with the latest version of OS...

And now I'm getting to the point that @hcho112 mentioned in one of the previous comments ( pinging /new_account endpoint ) which returns a 401 response but I guess that is the issue with the MPC Recovery service.

hcho112 commented 2 months ago

@alenNBH Glad to hear. The adoption of passkey is actually fairly recent so it make sense that updating OS fixed the problem. Since this is no longer problem with passkey, we can consider this issue has been resolved?

vikinatora commented 2 months ago

I agree that we can close the issue, even if there's some problem, I don't believe it's near-api-js the root cause