AccessToken.aspx - Error 400: Bad Request RRS feed

  • Question

  • Hi all,

    I'm trying desperately to authenticate Live users on my website using Messenger Connect but can't manage to make it work. I get an error when trying to get a token from AccessToken.aspx after Connect.aspx successfully sends the verification code to the callback handler: Error 400 - bad request.

    Thank you

    • Changed type Shaka Saturday, October 30, 2010 1:28 AM
    Saturday, October 30, 2010 1:27 AM


  • Ok problem resolved.

    Error 400 doesn't tell enough so we need to catch the WebException returned by AccessToken.aspx. May I suggest to include that piece of code in the sample from the developer guide? As I do not develop on the machine that hosts the web site, Fiddler is useless for that part of the process.

    So the problem was that I didn't send back the correct callback url (using the same session id). See this thread: http://social.msdn.microsoft.com/Forums/en-US/messengerconnect/thread/32311ffa-281f-4bb3-8394-b80ba41d0d2b

    I'm still having problem when forming the callback url using HttpContext.Current.Session.SessionID, so I use the wl_session_id formerly sent to and then returned back by AccessToken.aspx instead (callback + "?wl_session_id=" + Request.QueryString["wl_session_id"]). Still, I can't see why Context.Session.SessionID sent to AccessToken.aspx and HttpContext.Current.Session.SessionID initiated by AccessToken.aspx have to be the same.

    Whatever, with some minor adjustments to the sample provided in the developer guide, it works.


    • Marked as answer by Shaka Saturday, October 30, 2010 11:54 AM
    Saturday, October 30, 2010 11:53 AM