none
Broken SharePoint Online remote authentication - redirect ending on error page

    Question

  • I have a .NET website that connects to a SharePoint online site in order to access content from there. The authentication is done through the Office 365 login. In order to do that, I composed the following URL:

    https://login.microsoftonline.com/login.srf?wa=wsignin1.0&rpsnv=3&rver=6.1.6206.0&wp=MBI&wreply=https://www17204.sharepoint.com/_layouts/15/landing.aspx?Source=" + window.location 

    The wreply parameter varies, depending on the SharePoint site that the user entered. This code used to work perfectly for more than a year to obtain the STS token and then the FedAuth and rtFa cookies.

    Since around October 2015, it doesn't work anymore. The behaviour is the following: the browser navigates from my website to the login.microsoftonline.com address, it presents the user with the login form and after authenticating against Office 365 and then lands on the error page https://www17204.sharepoint.com/_layouts/15/error.aspx , instead of returning to my website.

    In the developer console I see a 500 Internal Server Error on Microsoft's end. Our implementation hasn't been touched in over a year, so I'm assuming Microsoft changed something which resulted in breaking our authentication mechanism.

    I can provide the correlation ID generated by the SharePoint Foundation error obtained with one of our test sites, if necessary.

    Any help or suggestion is greatly appreciated.

    Cheers,
    Crina

    Monday, February 8, 2016 2:01 PM