G
gsauns
I have an ASP.NET intranet site running off one of our servers.
The app, in the Session_Start event, logs a user's currently logged-in
Windows username to a session variable.
In the dev. environment, it's no problem - it gets a proper username.
However, when I go to the URL for the site, it actually pulls a
different username (I have one normal Active Directory account, and
one Domain Admin account). It sees me as my 'username_admin' account,
even though I am logged in as 'username'... I AM Remote Desktop-ed in
to a few other servers, and I thought this was the problem, but even
upon a reboot, and going to the site is the first thing I do, it still
pulls that username.
For several other people, it pulls the correct username.
On the server, in IIS for the site, i disabled anonymous access, and
checked off Integrated Windows authentication.
Here is the apporpriate code in my web.config file:
<authentication mode="Windows"/>
<authorization>
<allow users="*"/>
<deny users="?" />
</authorization>
Does anyone know the reason, and what I can do to change that so it
pulls my currently logged in username?
Here is the variable assignment code:
System.Security.Principal.IPrincipal ip;
ip = System.Web.HttpContext.Current.User;
Session.Add("Username", ip.Identity.Name);
The app, in the Session_Start event, logs a user's currently logged-in
Windows username to a session variable.
In the dev. environment, it's no problem - it gets a proper username.
However, when I go to the URL for the site, it actually pulls a
different username (I have one normal Active Directory account, and
one Domain Admin account). It sees me as my 'username_admin' account,
even though I am logged in as 'username'... I AM Remote Desktop-ed in
to a few other servers, and I thought this was the problem, but even
upon a reboot, and going to the site is the first thing I do, it still
pulls that username.
For several other people, it pulls the correct username.
On the server, in IIS for the site, i disabled anonymous access, and
checked off Integrated Windows authentication.
Here is the apporpriate code in my web.config file:
<authentication mode="Windows"/>
<authorization>
<allow users="*"/>
<deny users="?" />
</authorization>
Does anyone know the reason, and what I can do to change that so it
pulls my currently logged in username?
Here is the variable assignment code:
System.Security.Principal.IPrincipal ip;
ip = System.Web.HttpContext.Current.User;
Session.Add("Username", ip.Identity.Name);