Answered by:
Web service for Single Sign On on an Active Directory environment

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
-
User-1662538993 posted
Check the network setting for the web service hosted account for machine it is not working. There could be permission issue and thats why it is not working.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 15, 2013 2:42 PM -
User-488622176 posted
I think you should configure access to the web service enabling it to be called using Windows authentication. This will allow you to pass user context and get the AD user.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, October 17, 2013 9:55 AM -
User-488622176 posted
Your web service should belong to a web application. The configuration is done at web application level. Please check these links for detailed instructions on how to configure the IIS server & your web app:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, October 18, 2013 4:17 AM
All replies
-
User-1662538993 posted
Check the network setting for the web service hosted account for machine it is not working. There could be permission issue and thats why it is not working.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, October 15, 2013 2:42 PM -
User-488622176 posted
I think you should configure access to the web service enabling it to be called using Windows authentication. This will allow you to pass user context and get the AD user.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, October 17, 2013 9:55 AM -
User-823964292 posted
Hi Illeris,
can you please elaborate how can I configure access to the web service?
Friday, October 18, 2013 12:42 AM -
User-488622176 posted
Your web service should belong to a web application. The configuration is done at web application level. Please check these links for detailed instructions on how to configure the IIS server & your web app:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, October 18, 2013 4:17 AM