Re: User identity
- From: bruce barker <nospam@xxxxxxxxxx>
- Date: Wed, 29 Aug 2007 08:43:56 -0700
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)
gsauns wrote:
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);
- Follow-Ups:
- Re: User identity
- From: gsauns
- Re: User identity
- References:
- User identity
- From: gsauns
- User identity
- Prev by Date: Re: Bring window to top
- Next by Date: Re: Bring window to top
- Previous by thread: User identity
- Next by thread: Re: User identity
- Index(es):
Relevant Pages
|