using Windows authentication within intranet

From: Ethan Shayne (eshayne_at_bigfoot.com)
Date: 11/15/04


Date: 15 Nov 2004 11:45:51 -0800

I would like to set up a web service to use Windows authentication. I
understand how to do this in a situation where the client passes a
NetworkCredential instance, and have the web server authenticate for
me using Windows authentication.

However, in this particular case I know that the client will be within
the same intranet and on the same Windows domain as the web server.
And I want to have my web server authenticate based on the Windows
login already in use by the client application.

Here's what I've tried so far:
I started with setting <authentication mode="Windows"/> and <identity
impersonate="true"/> in my web.config file. I then set up IIS to turn
off anonymous access, and enable Windows authentication.

In my web method (C#, if it matters), I have code to look at
this.User.Identity.Name.

In my client application, I was able to successfully set Credentials
on my proxy object to a new NetworkCredential instance. When I use
this client application to call my web method, the web method
correctly reports this.User.Identity.Name as the one I set in the
NetworkCredential instance. And the web method call also correctly
fails if the username and password I set in the NetworkCredential
instance are not valid on this domain.

However, here's my problem: I had to fill in the NetworkCredential
instance in my client application with a username and password. What I
want is to pass a NetworkCredential instance representing the
currently logged-in user. In other words, if "freduser" already logged
into Windows and ran the client application, I want my web method to
report that this.User.Identity.Name is "freduser" - without having to
prompt the user for their password again in the client application.
Since I can't get the current user's password programmatically, I
don't know how to create the NetworkCredential instance without
prompting.

Can anyone tell me if there's a way to accomplish this?

Thanks,
Ethan



Relevant Pages

  • Re: Windows Authentication question
    ... That's still possible even if you use integrated Windows authentication. ... configured not to pass the client user credentials or because the client ... logon dialog by the browser. ...
    (microsoft.public.dotnet.framework)
  • Re: Windows Authentication question
    ... That's still possible even if you use integrated Windows authentication. ... configured not to pass the client user credentials or because the client ... logon dialog by the browser. ...
    (microsoft.public.dotnet.security)
  • Calling NetUserGetInfo from ASP.NET app
    ... I have an ASP.NET 2.0 app with windows authentication and impersonation ... Client User Name: ANONYMOUS LOGON ... the properties on teh server, and in the delegation tab, I've added every ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Getting user ID from Web Service credentials
    ... Windows Authentication in IIS, when Anonymous access is turned off. ... System.Net.CredentialCache.DefaultCredentials on the client side. ... >> any way to get the user name from the Web Services code. ... >> For both the client side caller and the Web Service, ...
    (microsoft.public.dotnet.security)
  • Re: Accessing files & folders on client/other machine
    ... I am setting the credentials before calling the web method. ... The problem is that Web Service needs to accesss a file on client machine. ...
    (microsoft.public.dotnet.framework.webservices)