server side session.challenge should be stored as base64? #209
-
relaying party: webAuthn.BeginRegistration returned a session containing a string type of challenge, not base64url user-agent: authenticator navigator.credentials.create() returned credential.response.clientDataJSON is base64urlEncode, clientDataJSON.challenge is also base64urlencode. these two challenges need to be the same when server side verification is required. My question is, should I encode the session.challenge returned at the time of BeginRegistration into base64url and then store it in session? Or should I decode the challenge in clientDataJSON from navigator.credentials.create() in browser before verifying? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The library handles the encoding / decoding and assumes you've used a fairly standard library to collect the data which would have the browser side content base64 encoded. You should store it as is or at least return it in the exact same format. |
Beta Was this translation helpful? Give feedback.
The library handles the encoding / decoding and assumes you've used a fairly standard library to collect the data which would have the browser side content base64 encoded. You should store it as is or at least return it in the exact same format.