0

I have a Sharepoint solution that uses the Security and Resources ASMX web services.

I'm currently using the hard-coded way of authenticating these services, but I want to implement a more universal way of doing it. I want to use the Windows credentials of the user that executes the program.

securityService.Credentials = new NetworkCredentials("Administrator","admin","domain");

I tried the following one, but with no success:

securityService.UseDefaultCredentials = true; //with and without this
securityService.Credentials = System.Net.CredentialCache.DefaultCredentials; //I also tried the DefaultNetworkCredentials

I get an

"Unhandled Communication Fault occured"

error when I try to access one of the web services functions

1

This is probably the classic NTLM double hop issue. Please see this other question: Password required? The remote server returned an error: (401) Unauthorized

  • Thanks for the answer! Not a good thing to see, since we cannot make sure, that the Sharepoint instance where it will be installed uses the Kerberos authentication.(the solution will be used on different setups) There should be a more universal way of getting data from the Sharepoint instance, where things like this are not making differences – Laureant Apr 21 '15 at 13:46
  • Yea, I agree. This is partly why MS is moving toward claims and the javascript model for development because then creds would more easily pass through to different end points. – Steve Lineberry Apr 21 '15 at 13:50
  • I'm really new to this whole Sharepoint thing, but I'm aware that ASMX is not the newest thing...Would you recommend going with a different interface, to get the data from sharepoint? – Laureant Apr 21 '15 at 13:54
  • It's kind of hard to say without understanding what you are trying to accomplish and your requirements. I've recently been moving toward using AngularJS with the SharePoint REST API for certain tasks. – Steve Lineberry Apr 21 '15 at 15:00
  • Basically, I want to get resource names (for example) and build up simple reports using the data. The functionality behind building up these reports is already working, only the way I get the data is still a problem – Laureant Apr 22 '15 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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