What is retrieved by using User.Identity.Name?

G

Guest

Hi all,
in my asp.net 2.0 (VB2005) application I use
httpContext.Current.User.Identity.Name to get the samaccount of the currently
logged in user, e.g. DOM\UserA. This works fine for most users, but with just
1 user we have a case-sensitive problem: It always returns DOM\userA, so a
small "u" at the start. I've checked his AD-Settings and they seem to be
correct. I've checked his login (he needs to login to both Windows and then
Terminal Server) so he really logs in with DOM\UserA (with a capital "U").
Nevertheless it does not help, my web app still recoginzes him as DOM\userA.
I've checked
http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.user(vs.80).aspx
without success. On IIdentity.Name I got this information "The user name is
passed to the common language runtime by the operating system or other
authentication provider (such as ASP.NET)." which also does not really help.

So which field is used to retrieve HttpContext.Current.User.Identity.Name?
Many thanks in advance!
 
G

Guest

Hi Kevin,

thanks for the reply, but I don't want to retrieve anything from the Active
Directory. I just want to know how ASP / IIS 6 retrieves / computes the value
which is returned when using HttpContext.Current.User.Identity.Name? One user
logs in with DOM\UserA but it returns DOM\userA. Why is there a small 'u'
instead of a capital one? For me I could log on as I like, it ALWAYS returns
DOM\UserB (also when I login to Windows using DOM\userb).
Thanks
 
P

Patrice

It returns the "user name" whatever authentication method you are using so
the real source could differ.

My guess is that you are using integrated authentication. I'm not sure what
is the problem. AFAIK the username is not case sensitive i.e. UserA and
userA are the same user.

I would likely look at where the username is used and needs to be in a
particular case rather than to try to use a particular case from the start.

Technically I believe it returns the "Windows 2000 legacy name" or something
similar...
 
S

Steve

More than likely, it's the AD user object. Check all properties of that
user (including the object's name itself) for the lowercase "u".


Steve C.
MCAD,MCSE,MCP+I,CNE,CNA,CCNA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top