Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using default ASP.Net MVC setup, how do I Sign in using a Microsoft Account?

Why do I continuously receive "The provided value for the input parameter 'redirect_uri' is not valid."?

My site is hosted in Azure. I'm trying to Login via the Microsoft sign-in button. I haven't really made many changes from the default ASP.Net MVC out-of-the-box template. All I've really changed was to uncomment the app.UseMicrosoftAccountAuthentication line and add the clientId and clientSecret.

Do I have the Redirect URL set up incorrectly?

Site: http://mysite.azurewebsites.net

Redirect URL: http://mysite.azurewebsites.net/

I read somewhere that you need to specify a Redirect URL in the form of http://www.mysite.azurewebsites.net. Can anyone confirm or deny that? I do not need the www in my current set up.

The error I consistently receive is:

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

This message is displayed on the page returned after an attempt to login:

Microsoft Account

We're unable to complete your request

Microsoft account is experiencing technical problems. Please try again later.

3/26/2014 Update: No luck so far, here's some screen shots of my settings in case it helps. Basic Information

enter image description here

API Settings

enter image description here

Is this a problem on Microsoft's side or am I doing something wrong?

like image 352
Mark Avatar asked Mar 18 '14 02:03

Mark


People also ask

What is form authentication in ASP.NET MVC?

The default Web application project template for ASP.NET MVC provides a controller, data models, and views that you can use to add ASP.NET forms authentication to your application. The built-in functionality lets users register, log on and off, and change their password.


1 Answers

From the default MVC what works for me (just tested about 5 minutes ago) for the redirect URL is

http://testcrap.azurewebsites.net/signin-microsoft

All the documentation I've found says to use

http://testcrap.azurewebsites.net/login/microsoftaccount

But that doesn't work for me... signin-microsoft does

enter image description here

OR if that doesn't work then use something like firebug to see what the request to the oauth provider looks like and then whatever the redirecturi is inside of that request is what you need to use..

enter image description here

like image 99
Shane Neuville Avatar answered Sep 19 '22 13:09

Shane Neuville