I would like to ask a question regarding id and rawId.
When implementing webauthn, in the authenticator attestation response, I see that we have both id and rawId . Reading the spec (https://www.w3.org/TR/webauthn-1/#dom-publickeycredential-rawid) , id is base64url(rawId)
{
"type": "public-key",
"id": "AV1--2gCLXLF9_5bGWDwZn6FP_OqAWfKY74mckatWMgN65o5OW8q2k9XVbYl8kAqPtpEoBlM0opKEjwDqYRBDIYbAl058O8ZQWS-r0M0L-9ikcu3tKuMxfFnRZ9gU6tnDH6QqzYwUg",
"rawId": "AV1--2gCLXLF9_5bGWDwZn6FP_OqAWfKY74mckatWMgN65o5OW8q2k9XVbYl8kAqPtpEoBlM0opKEjwDqYRBDIYbAl058O8ZQWS-r0M0L-9ikcu3tKuMxfFnRZ9gU6tnDH6QqzYwUg",
"response": {
...
}
...
}
So here is my questions:
- why we need
id - why in the example above, my
idis exactly likerawId?- does it's always the same? If it does, can we get rid of
idin the response?
- does it's always the same? If it does, can we get rid of
- If I save the public key
idto the database (later use that public keyidto create theallowCredentialslist), which one below should I follow?- save
idin the database, useidto create allowCredentials list - save
base64url(rawId)in the database, then use that base64 url encoded value to createallowCredentialslist
- save