code-specialist / fastapi-keycloak

Keycloak integration for Python FastAPI
https://fastapi-keycloak.code-specialist.com/
Apache License 2.0
193 stars 50 forks source link

preferred_username as default field representation in OIDCUser model #14

Closed fabiothz closed 2 years ago

fabiothz commented 2 years ago

The preferred_username field is always used to represent the user, and a username or email can be chosen to fill in this field.

If the admin chooses not to use the username field as an email, allowing users to register with just a username, without filling in the email field, the representation of the OIDCUser model does not show this user identification.

Therefore, I propose that the preferred_username field be the field to be shown in the representation of the OIDCUser model

code-specialist commented 2 years ago

Definitely an improvement regarding clarity and generality. Thank you for this proposal Fabio.