authentication problem

  • Thread starter Thread starter Keith
  • Start date Start date
K

Keith

I am a newbie so I hope this is an easy one. I have an asp.NET app
(.NET 2.0) using windows auth. I am just trying to get the username
of the logged-in user (I mean their windows login, exchange 5.5 with
active directory). My AD domain is called "US" and my login is
"kstay"

So, my web.config file says <authentication mode="Windows" />, and I
am using the following 2 calls:
Context.User.Identity.Name.ToString
Context.User.Identity.AuthenticationType

They works fine in development environment on my machine, they return
"US\kstay" and "NTLM" respectively. Thats' what I want to happen!

THE PROBLEM is when I move it to my test server (win 2k3, IIS6) the
two calls return "USkstay" (no slash in between) and "Negotiate"
respectively.

If I add <identity impersonate="True" /> to my web.config, it seems to
make no difference.

If I check "Enable anonymous access" in the website properties of IIS,
the two calls return "" and "" respectively.

Please help! Am i using the wrong calls? Wrong settings? Wrong
web.config params?
 
Hi,

Impersonation means that further resource access would happen under the
account you impersomate as, not by the process identity (NETWORK SERVICE in
IIS 6.0 usually).If you enable anonymous access, you naturally get ""
because there's no authentication in that case.

Perhaps following article helps in understanding:http://msdn.microsoft.com/msdnmag/issues/05/09/SecurityBriefs/default...

--
Teemu Keiski
AspInsider, ASP.NET MVPhttp://blogs.aspadvice.com/jotekehttp://teemukeiski.net












- Show quoted text -

Teemu,
That's helpful, thanks. Any thoughts on my specific problem though?
I am just trying to get the windows login so I can look them up in a
database - not to authenticate them, just to identify them.

Thanks for any insight.
 
Back
Top