-
Notifications
You must be signed in to change notification settings - Fork 84
User's mail should definitely not be taken from the "email" field in OAuth response #459
Comments
This should be a configurable field. I have an app, already written, with users in the database, and the value is coming from Suggested solution:
And then in backends:
|
We have existing admin users prior to adding django_microsoft_auth (dma). |
That should already be supported. Set |
Ideally (for full AD support), the Microsoft / Django field mappings should be configurable. As previously stated elsewhere, this package was only really designed for the common tenant (Microsoft accounts). |
With MICROSOFT_AUTH_AUTO_CREATE = False , It seems it doesn't create a |
Hey folks, hope y'all doing well.
In this code snippet, the mail of a new user is taken from the field
email
in the OAuth response.django_microsoft_auth/microsoft_auth/backends.py
Lines 167 to 180 in 2c50bcf
This is really dangerous and should definitely not be done this way! The
email
field can be set by the tenant administrator and does not necessarily represent the actual user's mail. Please, take theupn
field from the response. It actually represents an unique usernameThe text was updated successfully, but these errors were encountered: