Connecting to on premise SharePoint

I had developed a website to connect to SharePoint resources (mainly PWA) using following code:

_ProjectContext projContext;
projContext.AuthenticationMode = Microsoft.SharePoint.Client.ClientAuthenticationMode.Default;
System.Security.SecureString password = new System.Security.SecureString();
foreach (char c in pass.ToCharArray()) password.AppendChar(c);
projContext.Credentials = new System.Net.NetworkCredential(user, password, domain);
projContext.Load(projContext.Projects);
projContext.ExecuteQuery();
_

This code is working fine as a website. However, while I am trying to incorporate same in Xamarin mobile, I am getting following error:

System.Net.WebException: The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest

Request your help in resolving this.

Sign In or Register to comment.