Conversation
Edited 2 years ago

has someone worked with webauthn in here? i’m trying to test my code on localhost (rp_id localhost, allowed origin http://localhost:8080) but no matter what i do i am just getting the following error:

NotAllowedError: CredentialContainer request is not allowed.

#WebAuthN #WebDev #Javascript #InfoSec

2
0
2

@charlotte Does it only work on SSL cert covered pages?

1
0
0
@ceralor i should work over http.reading the Firefox source code for the error message it seems that it thinks that localhost:8080 is not the same origin as localhost, despite requests to other localhost ports not being considered cors
1
0
1

@charlotte WebAuthn works fine in "secure contexts", of which http://localhost (with or without a custom port) is one of them.

What do your options look like that you're passing to one of the WebAuthn API methods?

1
0
1

@iamkale i’m passing https://thermalpaste.technogothic.net/p/J69pXI.json to navigator.credentials.create (with user.id and challenge being an ArrayBuffer instead of base64 strings, this is just what the server is returning) and the error occurs both when calling the method from wasm or the dev console

I also tried the code on https://webauthn.guide/ with the rp id adjusted, which failed with the same error

1
0
0

@charlotte This is jumping out to me:

...and the error occurs both when calling the method from wasm or the dev console...

You'll have a better time with WebAuthn if you switch to Chrome (which allows making WebAuthn calls from the dev console), or from within a <script> tag on the page in all browsers. And calling navigator.credentials via WASM is right out as it doesn't have access to where all the credential magic happens in the main JS thread.

TIL Firefox won't let you make a WebAuthn request from the dev console, interesting choice.

Anyway if you want to have an easier time playing around with WebAuthn then my suggestion is to wire up basic UI in an HTML document to make the WebAuthn calls, or switch to Chrome and use its dev console if you just want to copy-paste-execute JS commands.

1
0
0

@iamkale wasm is in fact calling navigator.credentials.create using autogenerated bindings. That code is being executed just fine

……Trying it in chromium it seems that my code asks for my authenticator pin which might be why it doesn’t work in firefox huh

1
0
0

@charlotte

...wasm is in fact calling navigator.credentials.create using autogenerated bindings. That code is being executed just fine

Oh, intriguing! I'd love to know more about your use of WASM here if you can share.

……Trying it in chromium it seems that my code asks for my authenticator pin which might be why it doesn’t work in firefox huh

Are you on macOS? Firefox on macOS has historically not been able to perform UV so that might be complicating things. CTAP2 support is coming soon though so there's that to look forward to.

2
0
0
@iamkale trying around some more it seems that asking for the pin is normal chrome behavior and not misconfiguration on my part

I'm on linux
1
0
0

@charlotte @iamkale chrome will ask for a PIN if you set userVerification to "required", "preferred", or leave it unset and the key has a PIN set.

0
0
1

@iamkale Okay i solved this

On firefox credential requests require direct user interaction to succeed, have too long of a wait between clicking a button and the credential requests and it fails with that message.

#FIDO2 #WebAuthN #Firefox

0
1
3