lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.59k stars 461 forks source link

Problem with receiving code and state when using Microsoft as provider #678

Open feyruzb opened 2 months ago

feyruzb commented 2 months ago

Describe the bug

When trying to fetch access code there is a problem with retrieval of the code from page URL

Error Stacks

authlib.oauth2.rfc6749.errors.MissingTokenException: missing_token: Missing "access_token" in response.

To Reproduce

try to fetch a token using Microsoft details and command .fetch_token() you will get the above error.

Expected behavior

it should return a Bearer token for retrieving user information

Environment:

Additional context Quick fix on my side : code = url.split("code=")[1].split("&")[0] url = url.split("?")[0] + "?code=" + code