473,667 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve current Windows User Handle from ASP

Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?

I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
code:

WindowsIdentity id = HttpContext.Cur rent.User.Ident ity as WindowsIdentity ;
if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye
Jul 19 '05 #1
2 3656
I don't think ASP provides any intrinsic way to access the user token - you
might be able to do it in a COM object.

Cheers
Ken

"Stefano" <st************ *******@giasoft .it> wrote in message
news:OC******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?

I would like to retrieve the correspondent in ASP for thi piece of ASP.NET
code:

WindowsIdentity id = HttpContext.Cur rent.User.Ident ity as WindowsIdentity ;
if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye

Jul 19 '05 #2
I use Basic Authentication (over SSL), so I retrieved the Base64 string from
ASP code, using HTTP_AUTHORIZAT ION servervariable.

In this way, I can decode the string and so I can have the user's
credentials.

So, I solved my problem.

But... I'm curious... what about retrieving user token by COM object?

Thanks!

Bye
"Ken Schaefer" <ke*******@THIS adOpenStatic.co m> ha scritto nel messaggio
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
I don't think ASP provides any intrinsic way to access the user token - you might be able to do it in a COM object.

Cheers
Ken

"Stefano" <st************ *******@giasoft .it> wrote in message
news:OC******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi all,

is it possibile to retrieve the current Windows User Handle from ASP code?
I would like to retrieve the correspondent in ASP for thi piece of ASP.NET code:

WindowsIdentity id = HttpContext.Cur rent.User.Ident ity as WindowsIdentity ; if (id != null)
{
IntPtr handle = id.Token;
}

I need to pass "handle" variable to a .NET method (using interop).

Thank you so much.

Bye


Jul 19 '05 #3

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

Similar topics

79
14064
by: Klaus Bonadt | last post by:
In order to protect software from being copied without licence, I would like to use something like a key, which fits only to the current system. The serial number of the CPU or the current operating system would be appropriate. However, I do not know how to retrieve the information. Could you help? Klaus
8
5371
by: Dutchy | last post by:
Dear reader, In an attempt to obtain the path to the quick-launch-folder in order to create a shortcut to my application-updates during installation , I thought to: 1- check if quick launch is used by the user 2- check if a link to my application is there 3- if so, obtain the path (ANY PATH) to the quick-launch-folder from existing button(s)
34
2431
by: kevin.watters | last post by:
Hi all, I have a need for a short program: Given a drive letter, it would recursively search through all directories, "generating" each filename that it encounters (need to pass each filename to a function). Can't help but think this "utility" already exists but f**ked if I can find it.
1
2464
by: John Yung | last post by:
Hi, I have a client (C# MS Excel Project) calling a Web Service to retrieve and update data. One of the business requirement is the client's NT Login ID, IP Address and computer name must be log for each web service method call. To get client information using integrated Windows authentication with ASP.NET client. You need to disable "Anonymous Access" and enable "Integrated Windows authentication". IE will automatically pass in the...
13
3424
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end of the form which is submit and cancel. After i have clicked submit, the information is stored directly into my corresponding database table. My problem here is i need to retrieve back the information submitted to display all the data that the...
0
1637
by: padhuwork | last post by:
Hi, I want to create a Windows DLL using VC++ 6.0 which connects to SQL Server. After establishing the connection, I want to retrieve records from table (query) and out put the recordset to a text file. Can you any expert, give me ideas as to how to go about? I have used the following code for connection and connection is successful. I m able to insert records (i got the code from codeproject website). I was successfully able to insert...
1
7461
by: ranju | last post by:
I am trying to spawn a process (say an exe file) with different user crendentials than that of the current user. 1) Called LogonUserEx() to logon the user and recieve a handle to the token that represents the logged-on user. 2) Called ImpersonateLoggedOnUSer() to let the calling thread impersonate the security context of logged on user. 3) Used CreateEnvironmentBlock() to get lpEnv
11
3768
by: kudruu | last post by:
Hi, I am trying to find a way to populate a list of active Com ports on a computer. There may be around 30 on one computer and all connected to different Buses but I am looking for one in particular that is emitting packets that I need to monitor. Is there a function in C (maybe using winAPI) that will return the list of com ports? Another question I have is whether I am using CreateFile correctly. For debugging purposes you can see I...
8
2489
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
0
8457
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8883
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8788
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8646
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7390
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6203
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.