Pages

Wednesday, June 10, 2009

Anonymous access into SharePoint web services

Till now I didn’t find how to anonymous access web services, we can impersonate our SharePoint object model code by writing block of code under SPSecurity.Runwithelevatedprivileges method, I am looking for something like this for my web services code, I tried to find solution from internet, but I didn’t get success.

 

I can run or authenticate my web service code by passing current user credentials or any custom credentials (user name, password, domain name), but I am looking something different in authentication mode, please reply to me if any of you find some solutions or any alternatives for my challenge problem and I’ll also do same thing.

 

Thank you very much!

6 comments:

  1. Any luck with this? I have a client pulling his hair out with the same issue.

    ReplyDelete
  2. No, till now I didn't find anything which will solve my problem, but I'll definitely let you know if I see any workaround.

    Thanks,
    Sanket

    ReplyDelete
  3. Sanket,

    Hello. I wanted to see if I am running into the same situation you are...

    I have an HTML page that has JQuery ajax call to submit values to the SharePoint Lists.asmx web service. The SharePoint site is completely anonymous, yet when my ajax POST is fired off, I am prompted for NTLM credentials (windows login).

    Is this what you ran into, and tried working around? If so, what did you end up doing?

    If you can send your response to sean.boltman@epok.net as well, that would be greatly appreciated.

    Thanks!

    ReplyDelete
  4. Hey Sean,

    No, my situation and problem was different then you, actually I was trying to find out any way to call my SharePoint web services code as anonymous user, because my current user don’t have credentials to access some of the web method from SharePoint web service call.

    But looking at your situation, I am guessing that you can try below two things.

    1. I know if we set correct value into IE -> Internet options -> security tab -> Local Intranet zone -> User authentication method for not asking and prompting windows credentials every time then at some time, it’s working fine.

    2. I am not very familiar with Jquery AJAX call, but there must be something to pass current user credentials to web service call.

    Good Luck with your challenge.

    Thanks,
    Sanket

    ReplyDelete
  5. Hi Sanket,

    The following steps might help:
    1. Extend the Web Application to a new Zone (Intranet).
    Let’s say your Default Zone URL is : http://teams.SPWebApp.com/ then the extended Web Application URL would be : http://servername:portnumber/

    2. Disable Anonymous Access on the new Zone (Intranet)

    3. Use the Extended Zone (Intranet) URL to call the web services

    I solved the Anonymous Access issue with the Search.asmx the same way.

    Good Luck !

    - Ruchir

    ReplyDelete
  6. Hey Ruchir,

    Solution looks good and seems very promising, it's really milestone to achieve Anonymous Access into web service.

    Thank you very much for sharing your knowledge.

    Thanks buddy,
    Sanket

    ReplyDelete