Skip to content
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

Do not use username for PublicKeyCredentialUserEntity #217

Open
alfonsrv opened this issue Oct 11, 2023 · 2 comments
Open

Do not use username for PublicKeyCredentialUserEntity #217

alfonsrv opened this issue Oct 11, 2023 · 2 comments

Comments

@alfonsrv
Copy link

alfonsrv commented Oct 11, 2023

Overwriting the user model (dropping the username field in favor of email) causes registrations to not work. Admin fails with "An unexpected error occurred".

Instead, the username field should be derived from the registered User model's constant USERNAME_FIELD to support custom username fields.

Using either username or email however can lead to undesirable results. A change of name due to marriage, causing both a username and/or email change would cause FIDO2 auths to fail for intransparent reasons for an administrator and could cause some frustration. Might be a thing to consider.

Frankly, I'm not an expert on the matter and am sure there's cryptographic reason either field is used. Reading the W3 specs for id / user handle, it states the following though regarding the field in question:

The user handle MUST NOT contain personally identifying information about the user, such as a username or e-mail address; see § 14.6.1 User Handle Contents for details. The user handle MUST NOT be empty, though it MAY be null.

@tpazderka
Copy link
Contributor

@MichalPham please have a look as part of the changes you are implementing.

@MichalPham
Copy link
Contributor

will add

  • get_user_display_name,
  • get_username,
  • get_user_id

with current implementation which can be overridden by a setting callables

  • DJANGO_FIDO_GET_USER_DISPLAY_NAME,
  • DJANGO_FIDO_GET_USERNAME,
  • DJANGO_FIDO_GET_USER_ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants