HttpWorkerRequest, passing the anonymous user to ASP.Net

E

Eric Pearson

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
 
E

Eric Pearson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top