AngellusMortis / django_microsoft_auth

Simple app to enable Microsoft Account, Office 365 and Xbox Live authentcation as a Django authentcation backend.
MIT License
137 stars 84 forks source link

Getting Scope has changed from "email openid profile" to "User.Read email openid profile" #474

Closed califlower closed 2 years ago

califlower commented 2 years ago

Hi,

Running version 2.4.1 Running in docker on ubuntu I seem to be getting the following error (it seems new?) I haven't had this issue in the past. It seems new. I'm running in single tenant mode. I don't have any data in the database right now. It's empty with no users


Request Method: | POST
-- | --
http://localhost:8000/microsoft/from-auth-redirect/
4.0.3
Warning
Scope has changed from "email openid profile" to "User.Read email openid profile".
/usr/local/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/parameters.py, line 471, in validate_token_parameters
/usr/local/bin/python
3.8.12
['/app',  '/usr/local/lib/python38.zip',  '/usr/local/lib/python3.8',  '/usr/local/lib/python3.8/lib-dynload',  '/usr/local/lib/python3.8/site-packages']
nigelm commented 2 years ago

That error is coming from this section of code: https://github.com/oauthlib/oauthlib/blob/master/oauthlib/oauth2/rfc6749/parameters.py#L466

So it appears that you can do

export OAUTHLIB_RELAX_TOKEN_SCOPE=1

before running your app to make things work. However I am not sure of the other implications here...

alejomjc commented 2 years ago

That error is coming from this section of code: https://github.com/oauthlib/oauthlib/blob/master/oauthlib/oauth2/rfc6749/parameters.py#L466

So it appears that you can do

export OAUTHLIB_RELAX_TOKEN_SCOPE=1

before running your app to make things work. However I am not sure of the other implications here...

I did this, and dont solve the issue.

f1rsty commented 2 years ago

Edit "https://github.com/AngellusMortis/django_microsoft_auth/blob/master/microsoft_auth/client.py" and look for SCOPE_MICROSOFT = ["openid", "email", "profile"] change to SCOPE_MICROSOFT = ["User.Read", "openid", "email", "profile"]