I am getting a URI Redirect error for an Azure Application even though the URIs match

Viewed 149

I am building my first Azure application and am getting this error when I try to authenticate

AADSTS50011: The redirect URI 'http://127.0.0.1:5000/getAToken' specified in the request does not match the redirect URIs configured for the application

When I go into Azure and look at the redirect URI this is what the value is set to: http://localhost:5000/getAToken

The app is running locally on http://127.0.0.1:5000

What am I missing here? The URIs match exactly right? So why am I getting this error?

1 Answers

The redirect URI is matched as a string, not as a DNS-resolved URL. That means that localhost does not equal 127.0.0.1 in this case.

As Gaurav said you would have to use the same value in both places — either localhost or 127.0.0.0, but it has to be the same string value.

It doesn't matter how you access your app, you can still access it through localhost or 127.0.0.1. The thing that matters is the value that you send in the redirect_uri parameter. So, if in Azure you have the value http://localhost:5000/getAToken then send http://localhost:5000/getAToken in the redirect_uri parameter.

Related