You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, configuring a custom user name also via the OIDC_USERNAME_ALGO environment variable currently limits the username generation to usernames based on the user's email from the oidc claims.
defget_username(self, claims):
"""Generate username based on claims."""# bluntly stolen from django-browserid# https://github.com/mozilla/django-browserid/blob/master/django_browserid/auth.pyusername_algo=self.get_settings("OIDC_USERNAME_ALGO", None)
ifusername_algo:
ifisinstance(username_algo, str):
username_algo=import_string(username_algo)
returnusername_algo(claims.get("email")) # <-- this could accept claims as an argument to make it more general
It would be useful make the custom user name generation more general by also passing the claims, maybe in a backwards compatible manner.
A related issue that might be solved with the proposed change as well would be #482.
The text was updated successfully, but these errors were encountered:
At the moment, configuring a custom user name also via the
OIDC_USERNAME_ALGO
environment variable currently limits the username generation to usernames based on the user's email from the oidc claims.In auth.py:
It would be useful make the custom user name generation more general by also passing the claims, maybe in a backwards compatible manner.
A related issue that might be solved with the proposed change as well would be #482.
The text was updated successfully, but these errors were encountered: