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

Got "NoCredentialException" When using startAuthentication #2

Open
waggyman opened this issue Oct 23, 2023 · 1 comment
Open

Got "NoCredentialException" When using startAuthentication #2

waggyman opened this issue Oct 23, 2023 · 1 comment

Comments

@waggyman
Copy link

DESCRIPTION

I forked this project because I want to use it in my ionic project (using capacitor 5). Actually it's working well on startRegistration method. It show me the Biometric Pop Up.

After registering passkey and store it in my server.

I want to authenticate with this flow:

  1. Getting the passkey JSON Request:
GET: /api/generate_passkey?origin=android:key

{
  "challenge": "generatedString",
  "allowCredentials": [
    { "id": "same as the register passkey response" }
  ],
  "rpId": "my domain",
  "userVerification": "required"
}
  1. use the response when calling startAuthentication() method.
  2. But in the response I got the error "NoCredentialException"

QEUSTION

Do you know what causing that NoCredentialException error?

@darkedges
Copy link
Owner

darkedges commented Nov 22, 2023

Apologies for the delay in replying, have not been monitoring.

Have you tried sending a request with a blank list of existing credentials?

{
  "challenge": "T1xCsnxM2DNL2KdK5CLa6fMhD7OBqho6syzInk_n-Uo",
  "allowCredentials": [],
  "timeout": 1800000,
  "userVerification": "required",
  "rpId": "credential-manager-app-test.glitch.me"
}

It feels like it cannot find the credentials in the allowCredentials array.

Take a look at https://simplewebauthn.dev/docs/packages/server#1-generate-authentication-options on how to create a responses that is more compliant.

Spec here https://www.w3.org/TR/webauthn-2/#dictdef-publickeycredentialdescriptor

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

No branches or pull requests

2 participants