To give a little background on my setup, I'm running SharePoint 2013 Foundation configured with SAML authentication using ADFS. I'm able to access the SharePoint site using a web browser from both the SharePoint server and other client workstations.
I have a VB.NET console app which has a reference to the Microsoft.SharePoint.Client dll. To keep it short, the console app is simply trying to retrieve the name of the SharePoint site by using the ClientContext and loading the Web class. The code is failing on context.ExecuteQuery() with a 403 Forbidden error. What am I missing here? My code is below. Thanks in advance!
Dim context As ClientContext = New ClientContext("https://sharepoint.mydomain.com") context.Credentials = New NetworkCredential("<UserName>", "<Password>", "<Domain>") Dim web As Web = context.Web context.Load(web) context.ExecuteQuery()