Bad request (400) with OAuthWebSecurity.RegisterMicrosoftClient RRS feed

  • Question

  • http://stackoverflow.com/q/12663389/340760

    I am using Microsoft.Web.WebPages.OAuth. I was able to register GoogleFacebook,TwitterStack ExchangeMyOpenID...

    Now I am trying to add Microsoft Live, so I registered:

    OAuthWebSecurity.RegisterMicrosoftClient("applicationID", "key");

    and called

    OAuthWebSecurity.RequestAuthentication("microsoft", Url.Action("Authorization", new { returnUrl = "/" }));

    To this point everything is working fine, I get redirected to the login page. The problem is when I come back to


    It says:

    The remote server returned an error: (400) Bad Request.

    What do I have to do?


    • Edited by BrunoLM Monday, October 1, 2012 2:08 PM
    Monday, October 1, 2012 2:08 PM

All replies

  • Have you specified a return URL for your application on manage.dev.live.com?
    Monday, October 1, 2012 11:42 PM
  • I was getting an error related to this, so I had to specify an unique domain name and point it to onhosts file. After that it took some time and that error stopped. Does this code work for you?

    I though it was a bug on my app, but I created a fresh new app to a unique domain ( on hosts file), it asks my permission, I accept, it goes back to my app on OAuthWebSecurity.VerifyAuthentication() and breaks with (400) Bad Request 

    Tuesday, October 2, 2012 7:31 PM
  • I'm getting this, too. I believe it was working last week, and there were no code changes (to the best of my knowledge).

    I tried removing the app permissions from my live account and restarting IIS Express, but I'm still getting the 400 Bad Request error.

    Is it just me, or is anybody else witnessing some squirrely-ness with Live ID lately?

    Thursday, October 4, 2012 4:03 PM
  • Hi i have just tried it owith an app hosted on AZure and get the exact same error trying to logon with a Microsoft ID.
    HAve not tried with and other account.
    Wednesday, December 12, 2012 4:42 PM