I prepare OAuth login via Microsoft Azure with django-rest-social-auth lib. I configure azure like this:
Of course I add certificate secret key and register app with client id. I use Django REST lib which rests on social_core. I debug this app but I dont know what I do wrong. And I request for code to:
when I got the code I post to:
and when my lib doesnt work, below my request via django-rest-social-app:
{'method': 'POST', 'url': 'https://login.microsoftonline.com/common/oauth2/token', 'headers': {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': 'application/json', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': '214'}, '_cookies': <RequestsCookieJar[]>, 'body': 'grant_type=authorization_code&code=Md6d97b25-d830-9a29-20b3-6c97a482a3de&client_id=client-id&client_secret=ssecret&redirect_uri=http%3A%2F%2F127.0.0.1%3A8000%2F', 'hooks': {'response': []}, '_body_position': None}
I got message:
"error":"invalid_grant","error_description":"AADSTS9002313: Invalid request. Request is malformed or invalid.
I think ok, I dont have scope in this request, than I got postman and I post request with body:
and I got the same anwer.
What do I do wrong? Maybe someone use this lib or integrate with social_core with microsoft azure.