473,388 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Token of user identity

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.

Nov 19 '05 #1
3 1689
Hi,

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

User.Identity.Name

It gives you DomainName\userID.

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
In IIS, when 'anonymous user' is disabled anyone entering the site mustbe authenticated. After authentication, IIS's worker process assumesthe identity of the authenticated user rather than the identity of theworker process. So far I've only found code that obtains the token ofthe worker process' identity. That's not what I need. Is there a wayto obtain the token for the user? Thanks in advance.

.

Nov 19 '05 #2
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, pt******@hotmail.com wrote:
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.


--
Scott
http://www.OdeToCode.com/blogs/scott/
Nov 19 '05 #3
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.

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maya | last post by:
Hello, I have three questions, and any answer might help :) 1. I have the following situation: I have application that is launched from the SYSTEM User, so it runs under this user too. That of...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
15
by: Tom Nowak | last post by:
I am writing a webapp in which a user is required to enter a login id and password on a login form. I have forms authenticaion coded in my web.config. Once the user is logged in, I want to use the...
3
by: Patrick Olurotimi Ige | last post by:
How can i send LOGON_USER or User.Identity.Name to the Database? I'm working on a survey which is intranet based with Windows Authentication. I can get the current user by calling LOGON_USER or...
0
by: jakobsgaard | last post by:
It is possible to Map a certificate to a Active Directory User Account from DotNet? Please provide an example. Best regards, Ejnar Jakobsgaard...
26
by: ryampolsky | last post by:
I'm using strtok to break apart a colon-delimited string. It basically works, but it looks like strtok skips over empty sections. In other words, if the string has 2 colons in a row, it doesn't...
3
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
hi folks, I've got XP pro service pack 2 VS 2005 TSE with ASP.net 2.0 and C# I'm doing an example from Stephen Walther's so far excellent book and he has a whole load of stuff to add the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.