Closed MasterKale closed 9 months ago
This allows users who are storing credentialID as a base64Url (which is recommended)
Digging into this a bit, I can see how I might have been causing confusion within the docs:
The docs have suggested that RP devs base64url-encode credentialID
all this time, so why not save them a step? In retrospect credentialID should have always been a string 🤔
I went digging a bit and this idea potentially involves a reverting of some changes made in https://github.com/MasterKale/SimpleWebAuthn/pull/97 way back in February 2021 to emphasize more use of Buffer over base64url-encoded strings 🤯
This change is now available in the recently-published @simplewebauthn/server@10.0.0 ✌️
Describe the issue
A case has been made in #524 to allow
excludeCredentials
ingenerateRegistrationOptions()
andallowCredentials
ingenerateAuthenticationOptions()
to accept base64url-encoded strings in addition toUint8Array
's:After thinking about this a bit more I've come around to the idea. I agree that it would make these methods easier to use if credential IDs, otherwise represented as base64url-encoded values in WebAuthn, could remain strings from start to finish (at least with respect to calling the various methods in this project to leverage WebAuthn.)
It may even make sense to break the API here and only support use of base64url-encoded strings, for sake of a simpler library API 🤔
h/t @H3RSKO for the idea