PYTHON FLASK : AADSTS50011: The redirect URI 'http://127.0.0.1:5000/auth/redirect' specified in the request does not match

239 Views Asked by At

Hello I followed this : https://github.com/Azure-Samples/ms-identity-python-flask-webapp-authentication to deploy an azure sign-in in my local flask application.

I'm getting this error : AADSTS50011: The redirect URI 'http://127.0.0.1:5000/auth/redirect' specified in the request does not match the redirect URIs configured for the application '{...}'. Make sure the redirect URI sent in the request matches one added to your application in the Azure portal. Navigate to https://aka.ms/redirectUriMismatchError to learn more about how to fix this.

I have followed all the steps except the redirect url in the azure portal : I'm forced to put "https://localhost:5000/auth/redirect" instead of "https://127.0.0.1:5000/auth/redirect".

I'm a beginner on Flask so how do I match redirect URL ? Thanks

1

There are 1 best solutions below

2
PGHE On

Configure the app to use http not https. I.e. http://localhost:5000/auth/redirect

You're allowed to configure the app to have an http redirect as long as it's localhost.