-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use bytes
as user ID
#187
Comments
Historically the idea was that the RP had some string format decided for user IDs. "USR1234567", "98765431", or in lieu of a value like this then something like a V4 UUID could be used too. However the RP wants to serialize user ID bytes into a string, I didn't want to impose any such requirement on that part of how an RP determines its user identifiers. I take your point that this opinion isn't captured anywhere. I can add this to the README for a continued lack of a proper docs site. |
If the API encourages reusing an existing format, to me that seems counter to the spec and common guidance?
I don't think I'd have trouble using this library correctly myself, but the current API abstraction seems rather "easy to hold wrong" for someone who doesn't already have years of experience with WebAuthn. 😕 Personally, I think it would be a lot safer for the library to have a way to generate 64 random bytes by default, with other use cases behind additional steps. |
Strangely enough while working on #195 I discovered that
In light of this discovery, would making |
@jwag956 continuing our conversation from #195 (comment) since it's relevant to this issue:
In the last 24-48 hours I've been thinking that I need to simplify this towards defining the
Additionally, in L3, new JSON serialization types have been defined that also say https://w3c.github.io/webauthn/#dom-publickeycredentialuserentityjson-id And the new https://w3c.github.io/webauthn/#dom-publickeycredential-tojson I think I need to give up my "developer experience" crusade of trying to keep |
I've merged #197 that makes
This will go out as part of a bigger v2.0 release of this library. I'll follow up when that is available on PyPI. |
Alright, this change is out in the latest https://github.com/duo-labs/py_webauthn/releases/tag/v2.0.0 |
Given that the user handle is an
ArrayBuffer
in the WebAuthn API, I expected that theuser_id
value in this library would accept a random value ofbytes
. I was surprised to find that this is not supported.This is probably an intentional design decision, but I thought I'd report that requiring it to be a UTF-8 caused more friction for me than allowing randomly generated bytes.
When combined with this line, I can't figure out how to generate an ID using random bytes. I guess you have to generate a random UTF-8 string instead?
If the library is going to be opinionated about adding an abstraction over the actual WebAuthn API, I think it would at least be useful to have a function to generate a random string ID.
The text was updated successfully, but these errors were encountered: