Reputation: 526
This project authenticates with System.Security.Principal.WindowsIdentity
I had a look at this: Can't get HttpContext.Current.User.Identity to work in my WebMatrix project
IIdentity WinId = HttpContext.Current.User.Identity;//returns no data
WindowsIdentity wi = (WindowsIdentity)WinId;
I have disabled anonymous in my Web.config
<authorization>
<deny users="?" />
</authorization>
The wierd part is I have another project that uses the same code and has has the same .config but works,
Upvotes: 0
Views: 3650
Reputation:
Have you wrote this in your web config ??
<authentication mode="Windows"/>
and please just take a look this
System.Web.HttpContext.Current.User.Identity.Name Vs System.Environment.UserName in ASP.NET
Upvotes: 2