I am trying to allow o365 login in my Django project using "Django Microsoft Authentication Backend (https://django-microsoft-auth.readthedocs.io/en/latest/)" but I keep getting this error when i try to log in with my microsoft credentials.

AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: '******-*****-*****-*****-*********'. 

I have checked the links i added to my django project and in AAD but cannot figure out the problem

PS: i am doing testing on my local host i.e. localhost:8000

my redirect URI in AAD is :

http://localhost:8000/microsoft/auth-callback/

and i have set DEBUG = TRUE

In addition, i have chosen allow accounts in any organizational directory (multi-tenant) login option

2

There are 2 answers

0
Carl Zhao On BEST ANSWER

There is a general solution to the problem of not match:

When you visit the application url , you will be redirected to the login page. Decode the authorization request URL, you will find redirect_uri, copy the value of redirect_uri and paste it into the azure portal, and try again.

enter image description here

For the redirect URL, it should start with https, if you need to start with http, you must configure it as http://localhost.

0
AlfredoRevilla-MSFT On

Use Fiddler to capture the authorization request and find what is the actual value of the redirect_uri parameter being sent.