Forum Discussion

Sunil Guntupalli's avatar
Sunil Guntupalli
Copper Contributor
May 08, 2018
Solved

Project Online/SharePoint Online "401 Unauthorized" error when accessing oData URLs programatically

Hi All, I couldn't authenticate Project Online oData URLs using the below piece of code in a C# console application. It was working fine till yesterday from past 1 year. SecureString passWord =...
  • Daniel Colarossi's avatar
    Daniel Colarossi
    May 09, 2018

    Hi All,

     

    Another work around is to generate a SharePoint client context and then grab the auth cookie from those credentials and pass it to the rest api request.

     

    authCookie = creds.GetAuthenticationCookie()

    req.Headers.Add(HttpRequestHeader.Cookie, authCookie);

     

    Let me know if you need more details

     

    Thanks

     

    Dan

Resources