Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Here is my scenario:-

I have my Sharepoint server hosted on Domain A and I have my machine on Domain B. There is not any trust between Domain A and Domain B.

I am trying to access the Sharepoint Document library from my machine to Sharepoint server which is on Domain A.

Now when i used this code:-

ClientContext clientContext = new ClientContext(siteURL);
clientContext.Credentials = new System.Net.NetworkCredential(username,password,domain);
clientContext.ExecuteQuery();

I got the following error:-

The remote server returned an error: (401) Unauthorized 

I want to know (Correct me if i am wrong) is it possible to access sharepoint document library accross the domain without having trust between each other and the only solution i think is my machine should be on the Domain A.

Update

I transfered my machine on Domain A that is on that domain where sharepoint server is installed. Still same error getting at clientContext.ExecuteQuery();. I dont know why pelase help.

Please help.

Thanks in advance

share|improve this question
What type of authentication you are employing within the target web application on Domain A? And does the SharePoint server on Domain A know who username is? You may also want to see: sharepoint.stackexchange.com/questions/35933/… – nsturdivant Jan 4 at 5:30
NTLM windows authentication and our sharepoint server is on Domain A and yes the credentials which i am using are already exist on Doamin A means on Sharepoint server – Rahul Jan 4 at 5:37

1 Answer

You can and its called cross domain access that you would need to setup on the server, this is a link to another question with the answer:

http://stackoverflow.com/questions/12780886/cross-domain-access-in-sharepoint-2010

hope it helps :)

share|improve this answer
I transfered my machine to same domain but still getting the same error. – Rahul Jan 4 at 9:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.