"Required parameters missing in 'options.publicKey'" when using excludeCredentials #691
Unanswered
badlucksoft
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've only been working on getting the Webauthn library working within my project for a week or so, and I can successfully register a single credential without any problems. The problems occur when I attempt to use the excludeCredentials parameter in PublicKeyCredentialCreationOptions::create() to make sure the same authenticator isn't registered again.
Currently, I'm getting a vague error from Chrome stating that "Required parameters missing in
options.publicKey
."I'm building an array containing PublicKeyCredentialDescriptors created from reconstituted PublicKeyCredentialSources stored in my database from a json_array containing any and all registered credentials for the user. This is an excerpt from the function that builds the descriptors:
Those descriptors are then received in a variable called $excludeCredentials which I check against empty/failed values and build my publicKeyCredentialCreationOptions
The JSON sent to the client via AJAX looks something like this, where it is nested in another JSON object:
The only difference between the working version and this failing version, is the inclusion of excludeCredentials: $excludeCreds. In the javascript side of things, which I suppose are out of scope for the library, I convert the publicKeyCredentialCreationOptions.challenge, publicKeyCredentialCreationOptions.user.id, and publicKeyCredentialCreationOptions.excludeCredentials[*].id values into Uint8Array() from either base64, base64 url, or hex encoded strings as appropriate, but when running this, I get the Required parameters missing in `options.publicKey'. message:
I've spent quite a few hours trying to resolve this on my own, searching the web for a solution or hint, and even asking a few good AI chatbots for input on what might be happening, but haven't been able to resolve it. So, I thought I'd ask here. I'm sure there's a lot more information that's needed, please let me know what you need and I'll provide it if I can to get this resolved.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions