I am developing a web service that will be consumed from different client applications:
- MS Access,
- Lotus Notes,
- Internet Explorer javaScript,
- ...etc.
Previously, I have developed successfully a custom Authentication Class Module by using Custom Identity and Principal .NET Object. This module is used from my traditional Web Applications to provide custom Authentication against Active Directory and Form
Based Authentication (Dual Authentication), with Integrated Windows Authentication from within IE. This is working fine.
I need now to enable Authentication in the newly developed Web Services and to re-use the class module which I developed earlier.
I will post here my strategy, and I appreciate your comments and recommendation:
1. I will create a new virtual directory for the new web services, and create my Web Service Project,
2. Enable Windows Authentication in web.config for the Web Service Project:
3. Use this code sample shown below to get the "current" logged in user and Authenticate in a sample HelloWorld() web method (see sample below).
4. After getting the currently logged-in user, use the Custom Authentication Module to Login using the .NET Identity and Principal Objects from inside the same web service body as follows:
End Function
After calling the "Login" method of the Identity Object, all other references to the current Authenticated User are supposed to work as expected, I hope
!
I have done a simple test from MS Access 2003 to consum the above sample web service, and the LOGON_USER worked as expected, and it returned my current account name in Windows.
tarekahf
Member
143 Points
272 Posts
Authentication in Web Services.
Feb 06, 2010 01:16 PM|LINK
I am developing a web service that will be consumed from different client applications:
- MS Access,
- Lotus Notes,
- Internet Explorer javaScript,
- ...etc.
Previously, I have developed successfully a custom Authentication Class Module by using Custom Identity and Principal .NET Object. This module is used from my traditional Web Applications to provide custom Authentication against Active Directory and Form Based Authentication (Dual Authentication), with Integrated Windows Authentication from within IE. This is working fine.
I need now to enable Authentication in the newly developed Web Services and to re-use the class module which I developed earlier.
I will post here my strategy, and I appreciate your comments and recommendation:
1. I will create a new virtual directory for the new web services, and create my Web Service Project,
2. Enable Windows Authentication in web.config for the Web Service Project:
After calling the "Login" method of the Identity Object, all other references to the current Authenticated User are supposed to work as expected, I hope
!
I have done a simple test from MS Access 2003 to consum the above sample web service, and the LOGON_USER worked as expected, and it returned my current account name in Windows.
Appreciate your feedback.
Tarek.