User identity

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);
 
B

bruce barker

the identity is the one the browser sends. you can config the browser to
ask before sending id, or use a runas to have the browser default to the
desired account.

-- bruce (sqlwork.com)
 
G

gsauns

the identity is the one the browser sends. you can config the browser to
ask before sending id, or use a runas to have the browser default to the
desired account.

-- bruce (sqlwork.com)

How do i do that?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top