DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 21 Aug 2007 08:08:02 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Kai
          2    Kevin Spencer
                 3    Kai
                        4    Patrice http://www.chez.com/scribe/
                 5    Steve


What is retrieved by using User.Identity.Name?   
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!
Date:Tue, 21 Aug 2007 08:08:02 -0700   Author:  

Re: What is retrieved by using User.Identity.Name?   
You can try using "distinguishedName" - See 
http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true 
for more information.

-- 
HTH,

Kevin Spencer
Microsoft MVP

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

"Kai"  wrote in message 
news:00BCAEEB-7BC6-4E1F-8C6E-1AAA7F2567E9@microsoft.com...

> 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! 
Date:Wed, 22 Aug 2007 07:29:49 -0400   Author:  

Re: What is retrieved by using User.Identity.Name?   
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

"Kevin Spencer" wrote:


> You can try using "distinguishedName" - See 
> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true 
> for more information.
Date:Wed, 22 Aug 2007 04:38:01 -0700   Author:  

Re: What is retrieved by using User.Identity.Name?   
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

"Kai"  a crit dans le message de news: 
B0DB09DA-8978-4EB8-9D64-FEBB4AD05189@microsoft.com...

> 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
>
> "Kevin Spencer" wrote:
>
>> You can try using "distinguishedName" - See
>> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true
>> for more information.
> 
Date:Wed, 22 Aug 2007 14:09:30 +0200   Author:  

Re: What is retrieved by using User.Identity.Name?   
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


Kai wrote:

> 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
> 
> "Kevin Spencer" wrote:
> 
>> You can try using "distinguishedName" - See 
>> http://www.microsoft.com/technet/scriptcenter/guide/sas_usr_doig.mspx?mfr=true 
>> for more information.
> 
Date:Wed, 22 Aug 2007 08:17:09 -0400   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us