Connecting Tech Pros Worldwide Help | Site Map

Token of user identity

ptran123@hotmail.com
Guest
 
Posts: n/a
#1: Nov 19 '05
In IIS, when 'anonymous user' is disabled anyone entering the site must
be authenticated. After authentication, IIS's worker process assumes
the identity of the authenticated user rather than the identity of the
worker process. So far I've only found code that obtains the token of
the worker process' identity. That's not what I need. Is there a way
to obtain the token for the user? Thanks in advance.

Elton Wang
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Token of user identity


Hi,

Since you deny anonymous access, you can get authenticated
user by

User.Identity.Name

It gives you DomainName\userID.

HTH

Elton Wang
elton_wang@hotmail.com

[color=blue]
>-----Original Message-----
>In IIS, when 'anonymous user' is disabled anyone entering[/color]
the site must[color=blue]
>be authenticated. After authentication, IIS's worker[/color]
process assumes[color=blue]
>the identity of the authenticated user rather than the[/color]
identity of the[color=blue]
>worker process. So far I've only found code that obtains[/color]
the token of[color=blue]
>the worker process' identity. That's not what I need. Is[/color]
there a way[color=blue]
>to obtain the token for the user? Thanks in advance.
>
>.
>[/color]
Scott Allen
Guest
 
Posts: n/a
#3: Nov 19 '05

re: Token of user identity


Hi ptran:

Do you have <authentication mode='Windows'/> and <deny users='?'/>
in your web.config? You should be able to cast Page.User.Identity to a
WindowsIdentity, which represents a token.

--s

On 13 Apr 2005 12:02:06 -0700, ptran123@hotmail.com wrote:
[color=blue]
>In IIS, when 'anonymous user' is disabled anyone entering the site must
>be authenticated. After authentication, IIS's worker process assumes
>the identity of the authenticated user rather than the identity of the
>worker process. So far I've only found code that obtains the token of
>the worker process' identity. That's not what I need. Is there a way
>to obtain the token for the user? Thanks in advance.[/color]

--
Scott
http://www.OdeToCode.com/blogs/scott/
ptran123@hotmail.com
Guest
 
Posts: n/a
#4: Nov 19 '05

re: Token of user identity


Actually, what I really need is the TokenPtr of the authenticated
user. That way I can get the SID of that user, and store it in the DB.
I only know how to get the tokenPtr of the process identity by the
code below.

WindowsIdentity wi = WindowsIdentity.GetCurrent();
IntPtr token = wi.Token;

the variable 'token' holds a pointer to the process identity. However I
need the tokenPtr of the authenticated user. ASP.NET doesn't seem to
have this capability.

Closed Thread