authlib
authlib copied to clipboard
Problem with receiving code and state when using Microsoft as provider
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:
- OS: Ubuntu
- Python Version: 3.10.12
- Authlib Version: 1.3.1
Additional context
Quick fix on my side :
code = url.split("code=")[1].split("&")[0]
url = url.split("?")[0] + "?code=" + code
Hi @feyruzb. I am not sure to really understand the problem you are describing. Where exactly do you put your fix code? What does it solve?