user.identity.name retrieved from which place?
am 22.08.2007 09:56:01 von kai
Hi all,
I already posted in on the ASP.net Newsgroup but due to further research it
seems to be an IIS-question(see
http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetai ls.aspx?Name=AspNetAccount
: The User.Identity object represents the identity that was passed from IIS).
We are using IIS6. Thanks in advance!
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.httpcont ext.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!
Re: user.identity.name retrieved from which place?
am 22.08.2007 10:48:24 von David Wang
On Aug 22, 12:56 am, Kai wrote:
> Hi all,
> I already posted in on the ASP.net Newsgroup but due to further research it
> seems to be an IIS-question(seehttp://www.bluevisionsoftware.com/WebSite/Ti psAndTricksDetails.aspx?N...
> : The User.Identity object represents the identity that was passed from IIS).
> We are using IIS6. Thanks in advance!
>
> 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 checkedhttp://msdn2.microsoft.com/en-us/library/system.web.h ttpcontext.user(...
> 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!
The answer depends on the authentication protocol(s) used by your
application.
I can tell you that IIS would not change the letter-case of the user
name because it gets it either directly from the user or from Windows
login. It's opaque to IIS as far as it is concerned because IIS only
cares about the user token.
Letter casing by custom authentication protocols running on IIS would
be the responsibility of that protocol implementation.
Thus, it is important for you to identify the sequence of
authentication protocols used by your application.
I suspect either you have overlooked something in AD for that user, or
you are using a custom authentication within ASP.Net that is causing
this.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//