Click here to Skip to main content
15,890,947 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello,
I have a web application that uses HttpContext.Current.User.Identity.Name (DOMAIN/NameUser)
It returns wrong user
For example I expect dar12101@..... and it returns dar09001@.....
Web application has 100 users and only two back wrong.
Here the code:
string windowsAuthentication = HttpContext.Current.User.Identity.Name;
Does anybody know tell me something?
Thanks
Posted
Updated 10-Nov-16 10:00am

Do the users have multiple sign-ons?

I would check in AD and see what their DN actually is, or see if their user name has changed since the last them they logged in.

If it's working for 98/100 users, I would lean towards AD configuration/account problems vs. chasing code for right now.

Cheers,
 
Share this answer
 
Thanks for reply,
but I have an application that works correctly, and my appication doesn't work correctly.
Plus it works in Firefox and not in Internet Explorer.
I think it can be a problem about IIS.
 
Share this answer
 
I tried to use another server (web server):
same server version, same IIS version.
HttpContext.Current.User.Identity.Name is correct.
I cannot find the reason.

Does anybody know tell me something?
 
Share this answer
 
For Windows Authentication, try the solution posted here
c# - How to get user name using Windows authentication in asp.net? - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900