Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

What is retrieved by using User.Identity.Name?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kai - 21 Aug 2007 16:08 GMT
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!
Kevin Spencer - 22 Aug 2007 12:29 GMT
You can try using "distinguishedName" - See
http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true
for more information.

Signature

HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

> Hi all,
> in my asp.net 2.0 (VB2005) application I use
[quoted text clipped - 19 lines]
> So which field is used to retrieve HttpContext.Current.User.Identity.Name?
> Many thanks in advance!
Kai - 22 Aug 2007 12:38 GMT
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

> You can try using "distinguishedName" - See
> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true 
> for more information.
Patrice - 22 Aug 2007 13:09 GMT
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...

---
Patrice

> Hi Kevin,
>
[quoted text clipped - 13 lines]
>> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true
>> for more information.
Steve - 22 Aug 2007 13:17 GMT
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

> Hi Kevin,
>
[quoted text clipped - 9 lines]
>> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true 
>> for more information.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.