A
Allister
Hey
I have an ASP.NET application that is on a Win2000 server in a domain with
Active Directory. There are a number of client machines on this domain that
access a website on the server. IIS has Integrated Authentication only, and
no Anonymous access. I use the User.Identity.Name in my C# code to get the
login name of the requesting user.
I have a very confusing issue when the domain login of a user is changed
(say, from "userZero" to "userOne"). If that user then accesses the site
again with their new login ("userOne"), the User.Identity.Name value in my
code is still returning the username as "userZero".
I thought this might have been some caching issue on the client so I
rebooted the client machine and accessed the site again. The server still
reports the login name to be "userZero". I've also tried accessing the site
from another machine, and the ASP.NET code is still returning "userZero" as
the login name. This is pretty fustrating since I use this value to locate
profile info for that user but ASP.NET isn't providing me with reliable user
information.
I've output a list of the actual server variables from the
Request.ServerVariables collection:
AUTH_USER: gamma\userZero
LOGON_USER: gamma\userOne
REMOTE_USER: gamma\userZero
LOGON_USER seems to be the only variable that is reliably correct. The
others are coming from some unknown, outdated source (a cache perhaps?).
Classic ASP seems to work fine, and I can't reproduce this under that.
Resetting IIS didn't resolve this, but completely rebooting the webserver
did. In my situation, this is not at all ideal, and username changes aren't
uncommon, given the number of users in the domain.
I've also reproduced this on a Windows 2003 server running the ASP.NET app.
I don't think this is a serverside page caching issue because I output the
current date & time with the request, and it is correct, so the code is
executing on every refresh.
My question is how do I get ASP.NET to correctly report the username (using
User.Identity.Name) after it changes on the domain? If this is a server
credential caching issue, how do I clear it, or force it to properly read the
user's credentials?
Cheers
Allister
I have an ASP.NET application that is on a Win2000 server in a domain with
Active Directory. There are a number of client machines on this domain that
access a website on the server. IIS has Integrated Authentication only, and
no Anonymous access. I use the User.Identity.Name in my C# code to get the
login name of the requesting user.
I have a very confusing issue when the domain login of a user is changed
(say, from "userZero" to "userOne"). If that user then accesses the site
again with their new login ("userOne"), the User.Identity.Name value in my
code is still returning the username as "userZero".
I thought this might have been some caching issue on the client so I
rebooted the client machine and accessed the site again. The server still
reports the login name to be "userZero". I've also tried accessing the site
from another machine, and the ASP.NET code is still returning "userZero" as
the login name. This is pretty fustrating since I use this value to locate
profile info for that user but ASP.NET isn't providing me with reliable user
information.
I've output a list of the actual server variables from the
Request.ServerVariables collection:
AUTH_USER: gamma\userZero
LOGON_USER: gamma\userOne
REMOTE_USER: gamma\userZero
LOGON_USER seems to be the only variable that is reliably correct. The
others are coming from some unknown, outdated source (a cache perhaps?).
Classic ASP seems to work fine, and I can't reproduce this under that.
Resetting IIS didn't resolve this, but completely rebooting the webserver
did. In my situation, this is not at all ideal, and username changes aren't
uncommon, given the number of users in the domain.
I've also reproduced this on a Windows 2003 server running the ASP.NET app.
I don't think this is a serverside page caching issue because I output the
current date & time with the request, and it is correct, so the code is
executing on every refresh.
My question is how do I get ASP.NET to correctly report the username (using
User.Identity.Name) after it changes on the domain? If this is a server
credential caching issue, how do I clear it, or force it to properly read the
user's credentials?
Cheers
Allister