473,770 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WS and Windows Authentication

Hi,

I need to develop a secure Web Service that requires a username and
password. One of the requirements is that the WS supports Windows
Authentication, meaning accepts the username and password the client used to
log on to Windows. The WS then needs to see which Active Directory roles
the user belongs to and allow the user (or not) to perform specific tasks
with the WS.

Can anyone please point me in the right direction as to the
technologies/SDKs I need to use? Specifically:

a) Client: How to gather the current login information and use it to
authenticate against my WS.
b) WS: How to authenticate the user against Active Directory?

Thanks in advance!
Dec 12 '05 #1
6 4009
GCR
If your web service is running in the intranet, than you have to configure
the directory security for the web service in IIS with integrated windows
authentication (only) and have in the web.config the <authenticati on
mode="Windows" /> and <identity impersonate="tr ue" />. This way you force the
web service to run in the security context of the calling user and you can
cast the Identity property of the User to WindowsIdentity .

"Jimmy" wrote:
Hi,

I need to develop a secure Web Service that requires a username and
password. One of the requirements is that the WS supports Windows
Authentication, meaning accepts the username and password the client used to
log on to Windows. The WS then needs to see which Active Directory roles
the user belongs to and allow the user (or not) to perform specific tasks
with the WS.

Can anyone please point me in the right direction as to the
technologies/SDKs I need to use? Specifically:

a) Client: How to gather the current login information and use it to
authenticate against my WS.
b) WS: How to authenticate the user against Active Directory?

Thanks in advance!

Dec 12 '05 #2
Thanks for your reply.

How do I access the user information from within the Web Service class?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:56******** *************** ***********@mic rosoft.com...
If your web service is running in the intranet, than you have to configure
the directory security for the web service in IIS with integrated windows
authentication (only) and have in the web.config the <authenticati on
mode="Windows" /> and <identity impersonate="tr ue" />. This way you force
the
web service to run in the security context of the calling user and you can
cast the Identity property of the User to WindowsIdentity .

"Jimmy" wrote:
Hi,

I need to develop a secure Web Service that requires a username and
password. One of the requirements is that the WS supports Windows
Authentication, meaning accepts the username and password the client used
to
log on to Windows. The WS then needs to see which Active Directory roles
the user belongs to and allow the user (or not) to perform specific tasks
with the WS.

Can anyone please point me in the right direction as to the
technologies/SDKs I need to use? Specifically:

a) Client: How to gather the current login information and use it to
authenticate against my WS.
b) WS: How to authenticate the user against Active Directory?

Thanks in advance!

Dec 12 '05 #3
GCR
Over the HttpContext.Use r property, that provides programmatic access to the
properties and methods of the IPrincipal interface. When you use Windows
authentication, the IPrincipal is an WindowsPrincipa l and over
WindowsPrincipa l.IsInRole method you can check the membership of the user in
a Windows group.

"Jimmy" wrote:
Thanks for your reply.

How do I access the user information from within the Web Service class?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:56******** *************** ***********@mic rosoft.com...
If your web service is running in the intranet, than you have to configure
the directory security for the web service in IIS with integrated windows
authentication (only) and have in the web.config the <authenticati on
mode="Windows" /> and <identity impersonate="tr ue" />. This way you force
the
web service to run in the security context of the calling user and you can
cast the Identity property of the User to WindowsIdentity .

"Jimmy" wrote:
Hi,

I need to develop a secure Web Service that requires a username and
password. One of the requirements is that the WS supports Windows
Authentication, meaning accepts the username and password the client used
to
log on to Windows. The WS then needs to see which Active Directory roles
the user belongs to and allow the user (or not) to perform specific tasks
with the WS.

Can anyone please point me in the right direction as to the
technologies/SDKs I need to use? Specifically:

a) Client: How to gather the current login information and use it to
authenticate against my WS.
b) WS: How to authenticate the user against Active Directory?

Thanks in advance!


Dec 12 '05 #4
Thanks again.

One more little problem:

I set the properties as you said in WebConfig.ini. Also, I set the website
in IIS to "Integrated Windows Security". But as soon as I remove "allow
anonymous access", I get an "Unauthoriz ed" exception on the client when i
call on a method, even though it is running under an authenticated domain
user.

Help?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Over the HttpContext.Use r property, that provides programmatic access to
the
properties and methods of the IPrincipal interface. When you use Windows
authentication, the IPrincipal is an WindowsPrincipa l and over
WindowsPrincipa l.IsInRole method you can check the membership of the user
in
a Windows group.

"Jimmy" wrote:
Thanks for your reply.

How do I access the user information from within the Web Service class?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:56******** *************** ***********@mic rosoft.com...
> If your web service is running in the intranet, than you have to
> configure
> the directory security for the web service in IIS with integrated
> windows
> authentication (only) and have in the web.config the <authenticati on
> mode="Windows" /> and <identity impersonate="tr ue" />. This way you
> force
> the
> web service to run in the security context of the calling user and you
> can
> cast the Identity property of the User to WindowsIdentity .
>
> "Jimmy" wrote:
>
>> Hi,
>>
>> I need to develop a secure Web Service that requires a username and
>> password. One of the requirements is that the WS supports Windows
>> Authentication, meaning accepts the username and password the client
>> used
>> to
>> log on to Windows. The WS then needs to see which Active Directory
>> roles
>> the user belongs to and allow the user (or not) to perform specific
>> tasks
>> with the WS.
>>
>> Can anyone please point me in the right direction as to the
>> technologies/SDKs I need to use? Specifically:
>>
>> a) Client: How to gather the current login information and use it to
>> authenticate against my WS.
>> b) WS: How to authenticate the user against Active Directory?
>>
>> Thanks in advance!
>>
>>
>>


Dec 12 '05 #5
GCR
Not WebConfig.ini, but web.config - this is the configuration file for
ASP.net applications!!! !!! See following link for further details:
http://msdn.microsoft.com/library/de...ewebconfig.asp

"Jimmy" wrote:
Thanks again.

One more little problem:

I set the properties as you said in WebConfig.ini. Also, I set the website
in IIS to "Integrated Windows Security". But as soon as I remove "allow
anonymous access", I get an "Unauthoriz ed" exception on the client when i
call on a method, even though it is running under an authenticated domain
user.

Help?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Over the HttpContext.Use r property, that provides programmatic access to
the
properties and methods of the IPrincipal interface. When you use Windows
authentication, the IPrincipal is an WindowsPrincipa l and over
WindowsPrincipa l.IsInRole method you can check the membership of the user
in
a Windows group.

"Jimmy" wrote:
Thanks for your reply.

How do I access the user information from within the Web Service class?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:56******** *************** ***********@mic rosoft.com...
> If your web service is running in the intranet, than you have to
> configure
> the directory security for the web service in IIS with integrated
> windows
> authentication (only) and have in the web.config the <authenticati on
> mode="Windows" /> and <identity impersonate="tr ue" />. This way you
> force
> the
> web service to run in the security context of the calling user and you
> can
> cast the Identity property of the User to WindowsIdentity .
>
> "Jimmy" wrote:
>
>> Hi,
>>
>> I need to develop a secure Web Service that requires a username and
>> password. One of the requirements is that the WS supports Windows
>> Authentication, meaning accepts the username and password the client
>> used
>> to
>> log on to Windows. The WS then needs to see which Active Directory
>> roles
>> the user belongs to and allow the user (or not) to perform specific
>> tasks
>> with the WS.
>>
>> Can anyone please point me in the right direction as to the
>> technologies/SDKs I need to use? Specifically:
>>
>> a) Client: How to gather the current login information and use it to
>> authenticate against my WS.
>> b) WS: How to authenticate the user against Active Directory?
>>
>> Thanks in advance!
>>
>>
>>


Dec 12 '05 #6
OK, I got it. I forgot to assign default credentials. Thanks for your
help!
"Jimmy" <NoSpam> wrote in message
news:uZ******** *******@TK2MSFT NGP14.phx.gbl.. .
Thanks again.

One more little problem:

I set the properties as you said in WebConfig.ini. Also, I set the
website in IIS to "Integrated Windows Security". But as soon as I remove
"allow anonymous access", I get an "Unauthoriz ed" exception on the client
when i call on a method, even though it is running under an authenticated
domain user.

Help?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Over the HttpContext.Use r property, that provides programmatic access to
the
properties and methods of the IPrincipal interface. When you use Windows
authentication, the IPrincipal is an WindowsPrincipa l and over
WindowsPrincipa l.IsInRole method you can check the membership of the user
in
a Windows group.

"Jimmy" wrote:
Thanks for your reply.

How do I access the user information from within the Web Service class?

Thanks!

"GCR" <GC*@discussion s.microsoft.com > wrote in message
news:56******** *************** ***********@mic rosoft.com...
> If your web service is running in the intranet, than you have to
> configure
> the directory security for the web service in IIS with integrated
> windows
> authentication (only) and have in the web.config the <authenticati on
> mode="Windows" /> and <identity impersonate="tr ue" />. This way you
> force
> the
> web service to run in the security context of the calling user and you
> can
> cast the Identity property of the User to WindowsIdentity .
>
> "Jimmy" wrote:
>
>> Hi,
>>
>> I need to develop a secure Web Service that requires a username and
>> password. One of the requirements is that the WS supports Windows
>> Authentication, meaning accepts the username and password the client
>> used
>> to
>> log on to Windows. The WS then needs to see which Active Directory
>> roles
>> the user belongs to and allow the user (or not) to perform specific
>> tasks
>> with the WS.
>>
>> Can anyone please point me in the right direction as to the
>> technologies/SDKs I need to use? Specifically:
>>
>> a) Client: How to gather the current login information and use it to
>> authenticate against my WS.
>> b) WS: How to authenticate the user against Active Directory?
>>
>> Thanks in advance!
>>
>>
>>


Dec 12 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3708
by: Bob Everland | last post by:
I have an application that is ISAPI and the only way to secure it is through NT permissions. I need to have a way to login to windows authentication so that when I get to the ISAPI application no boxes come up. I want an ASP page to sit between the user and the ISAPI application. The rest of my application is using authentication that is database driven and wouldn't want the users to know the userid and password. Is this possible? If so...
1
2135
by: sherkozmo | last post by:
I have my SQL 7.0 server set for Mixed security. I see now (finally) the advantages of having windows authentication security for windows groups. I do most of my developing in Access Projects which require a login of some type. I have been using my SQL login to develop with SQL and then when I give it to the user, I set the project to use Windows authentication. I want to be able to have Windows authentication on my domain account but...
1
528
by: Mark | last post by:
When our staff are logged into a computer on our domain, they're still prompted for their domain login and password to get into our ASP.NET application in Internet Explorer when using Windows Authentication. Is it possible to leverage the windows authentication from a client pc that is already on the domain and authenticated?? Thanks in advance. Mark
4
6807
by: Andrew | last post by:
Hey all, I would like to preface my question by stating I am still learning ASP.net and while I am confident in the basics and foundation, the more advanced stuff is still a challenge. Ok. :)
5
2698
by: pberna | last post by:
Dear all, I built a Web Form application to start and stop a Windows Service remotely. I successful tested the application on Windows 2000 server + IIS. I must include the ASPNET user to the Administration group (on server side) to have the necessary authorization to start a Windows Service (I don't understand why "Power User" rights are not enough to do the same thing) Although I'm able to start a service using windows 2000 server...
6
7554
by: Kevin Yu | last post by:
is it possible to for user to click a logout button to logout and when the user want to get into the system again, the user have to login again? Kevin
8
3437
by: Nils Magnus Englund | last post by:
Hello, I am having trouble using Integrated Windows Authentication between our intranet server and our database server, both of which are on our local domain. Windows authentication works for our intranet server - my domain user "DOM\nme" is correctly authenticated and authorized to view the ASP.NET page on our intranet. The ASP.NET application uses impersonation (<identity impersonate="true"> in Web.config).
10
4065
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to Pop up windows Authentication box so that user will give his userId, Password & domain name for authenticaion. After that I want to take these three info of user and make a search in Active Directory.
7
3030
by: Alice Wong | last post by:
I am setting up my Web ASP.net application to connect to Sql server using windows authentication. I set up IIS to have integrated windows authenication and sql to allow Windows authentication. And I trun annonymous login. I use this connection to connect. server={0};database={1};Integrated Security=SSPI where {0} servname and {1} database name
4
2354
by: Preben Zacho | last post by:
Hi there The scenario I got is this: I have created a Windows application in VS and I want to deploy it to another machine running Windows Vista. Since I have no control over this other machine, I've set it up to run SQL Authentication and I have added a new user called "MyUser" and applied a password. This user/password is used in my connection string whick looks like this: Server=.\SQLEXPRESS;Database=MyDB;User...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.