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

bad request on on microsoft login with error on shell #439

Closed emb-karan closed 3 years ago

emb-karan commented 3 years ago

could verify id_token sig: It is required that you pass in a value for the "algorithms" argument when calling decode(). Bad Request: /microsoft/auth-callback/

"POST /microsoft/auth-callback/ HTTP/1.1" 400 790

AngellusMortis commented 3 years ago

Dupe of #431

emb-karan commented 3 years ago

image

I have fixed the algorithm typo error in microsoft_auth/client.py, but still, I am getting the same error

emb-karan commented 3 years ago

Alright, I got it, went to Pyjwt doc https://pyjwt.readthedocs.io/en/stable/usage.html

code on line 149 should look like this

          claims = jwt.decode(
                token,
                public_key,
                algorithms=["RS256"], # correction needed here
                audience=self.config.MICROSOFT_AUTH_CLIENT_ID,
            )