Realtime authentication for ASP.NET MVC redirect url is not valid

I am trying to do realtime user authentication in my asp.net web application. I followed the steps in the below post

http://www.benday.com/2014/02/25/walkthrough-asp-net-mvc-identity-with-microsoft-account-authentication/

creating an app and setting up a domain on localhost works fine. Problem setting redirect url in app settings. When I run the application, it throws an error

"The value provided for the input parameter 'redirect_uri' is not valid. Expected value: https://login.live.com/oauth20_desktop.srf 'or a URL that matches the redirect URIs registered for this client application.

I tried " http://www.mysampleapp.com/Account/ExternalLoginCallback " and " http://www.mysampleapp.com/signin-microsoft ". and urls it didn't work. (mysampleapp is the url I hosted locally)

When I click on "Microsoft" in the outside of the authentication, I am directed to the URL below

"https://login.live.com/err.srflc=1033#error=invalid_request&error
_description=The%20provided%20value%20for%20the%20input%20parameter%20'redirect_uri'%
20is%20not%20valid.%20The%20expected%20value%20is%20'https://login.live.com/oauth20_desktop.srf
'%20or%20a%20URL%20which%20matches%20the%20redirect%20URI%20registered%20for
%20this%20client%20application."

      

How do I find the URL?

+3


source to share


2 answers


If you are using the new Microsoft Live Application Settings then redirect URLs: http://something.yourDomain.com/signin-microsoft

If you are using the old Microsoft Live app settings then redirect urls: http://something.yourDomain.com/Account/ExternalLoginCallback

Please note that "something" should not be www.



Don't use www, replace it with some subdomain name and set it correctly in the host file. That is how I got this work in my previous project to test this locally.

Hope it helps.

+5


source


Try setting this one http://myapp-url/signin-microsoft

to set the redirect urls.



+4


source







All Articles