locked
Web service for Single Sign On on an Active Directory environment RRS feed

  • Question

  • User-823964292 posted

    I have written a .net web service to access the name of the current logged in user. The following is the web service code -

    WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent()); 
    string username = wp.Identity.Name;

    When I run this web service in server, I am getting the correct o/p. But when I consume this web service from another machine, I am getting the following error-

    The request failed with HTTP status 401: Unauthorized.

    I am trying to achieve Single Sign On on an Active Directory environment. My idea behind creating a web service is that every application in my intranet will call this web service and the web service will return the username.

    Please tell me if the idea of the web service is a wise one. And if the web service is bound to help me, why I am getting "The request failed with HTTP status 401: Unauthorized." message?

    Tuesday, October 15, 2013 3:52 AM

Answers

All replies