473,288 Members | 1,729 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,288 software developers and data experts.

HttpWorkerRequest, passing the anonymous user to ASP.Net

I implement my own HTTP server and pass ASP.Net requests via HttpWorkerRequest.

When I authenticate a client, I pass the correct windows token inside of
GetUserToken(), and within my pages/webservices HttpContext.Current.User
matches the token I authenticated.

However, when I perform an anonymous request I get a token for the anonymous
user ("NT AUTHORITY\ANONYMOUS LOGON", S-1-5-7) and return that in GetUserToken.
When asp.net gets it, HttpContext.Current.User is a zero-token Identity
with name="", which is unusable. HttpContext.Request.LogonUserIdentity however
does contain the correct windows identity for NTAUTH\ANONYMOUSUSER.

I do not want to impersonate, I just need HttpContext.User to contain the
correct, actual windows identity of "ANONYMOUS LOGON". What could I be doing
wrong?

Any help greatly appreciated.
-Eric Pearson
May 18 '06 #1
1 1606
Nevermind, found the problem. I wasn't returning that identity's name from
GetServerVariable("LOGON_USER")...

once I returned the correct name there, HttpContext.User was set correctly.

I implement my own HTTP server and pass ASP.Net requests via
HttpWorkerRequest.

When I authenticate a client, I pass the correct windows token inside
of GetUserToken(), and within my pages/webservices
HttpContext.Current.User matches the token I authenticated.

However, when I perform an anonymous request I get a token for the
anonymous
user ("NT AUTHORITY\ANONYMOUS LOGON", S-1-5-7) and return that in
GetUserToken.
When asp.net gets it, HttpContext.Current.User is a zero-token
Identity
with name="", which is unusable.
HttpContext.Request.LogonUserIdentity however
does contain the correct windows identity for NTAUTH\ANONYMOUSUSER.

I do not want to impersonate, I just need HttpContext.User to contain
the correct, actual windows identity of "ANONYMOUS LOGON". What could
I be doing wrong?

Any help greatly appreciated.
-Eric Pearson

May 18 '06 #2

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

Similar topics

2
by: Kevin Hoskins | last post by:
Is there anyway to force authentication of the Anonymous user? Here is the situation: I have an ASP.NET page which calls an assembly which requires a certain level of permissions. The page is...
5
by: Patrick.O.Ige | last post by:
Whats the best way to pass Data with hidden fields in asp.net. I want to capture a LOGON_USER(from an intranet using Windows Authentication)and then send the data to a table in the Database. Any...
6
by: Anonymous | last post by:
Hello, I am loading a usercontrol with the LoadControl method and need to pass some data to the property of that control. How can I do that? THanks
8
by: Bryan G | last post by:
Hi, I'm working on a VB project which involves using C library functions which take struct pointers as args, and I keep running into this error when trying to pass either an IntPtr or a Structure...
7
by: DareDevil | last post by:
I have written a method that should modify the folder path passed to it into one that exists and is selected by the user. It then returns a boolean depending on whether a folder path was selected by...
2
by: Witold Iwaniec via .NET 247 | last post by:
It seems that when you pass an object to a function it is always passed by reference even if it is explicitly declared ByVal. Is it the behavior of VB.Net? Here is sample code from sample Asp.Net...
3
by: GRB | last post by:
My webiste has integrated windows authentication. I need to pass a clients credentials (username, password) to my site without the login pop up. I send the client to an anonymous page, get an...
2
by: Jay Balapa | last post by:
Hello, Win Forms app is able to connect to my webservice passing credentials as follows- myService.Credentials=System.Net.CredentialsCache.DefaultCredentials; Compact Framework does not...
3
by: shapper | last post by:
Hello, On my web site I have a property, Visitor, which is available for Anonymous users: public class Visitor { public CultureInfo Culture { get; set; } public List<GuidPolls { get; set;...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.