Length of rawId and id

Passkeys’s properties rawId and id aren’t consistent.

Back to caveats_

Passkeys have a id property equal to their rawId value (an ArrayBuffer) encoded in base64. However, the id property will remove the padding of the value (i.e. the = character), making it sometimes a different length than if you were to encode the rawId in bas64 yourself. Both values are valid base64 encoded strings (i.e., decoders will understand them) but ideally default to using id to avoid these length discrepancies.

Back to caveats_

By 0xjjpa.

MIT License'd code available in GitHub.

Last updated - Sun Oct 08 2023