Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

401 unauthorized for ExecuteQuery

$
0
0

I have a farm solution (webpart) using Client object model and when deploy to SharePoint it throw 401 unauthorized error.

when I use this with my user and pass hardcoded in this line then it'll work

NetworkCredential credentials = new NetworkCredential("username", "pass", "domain");
context.Credentials = credentials;

But when I use default credential as below then throw 401 error.                

context.Credentials = CredentialCache.DefaultCredentials;

I tested with console app and both line are working with no error, it just the default credential in deploy to sharepoint 2013, error happening.

Domain name and netbios name are different.

Appriciate any help.


.


Viewing all articles
Browse latest Browse all 25064

Trending Articles