WindowsIdentity in legacy ASP
I created a .Net library at work which is used by all of our developers. The security part uses Microsoft AzMan for the security backend. To create a ClientContext for security (AzMan), I have to pass it a token value (as a uint). All of this is fine until I need to make a COM wrapper for our shared library, so some of our legacy pages can take advantage of it without rewriting at the moment.
I cannot figure out how to pass the token value to AzMan from the old ASP. The COM wrapper is configured to act as a COM server and runs as a specific user, which we use here for all COM objects, so the shared library can't just pull the ID using .Net.
Any ideas?
If you can't get the token, you can always use IAzApplication.InitializeClientContextFromName by getting the username from the request in your asp page and passing it to your com + component.
http://msdn.microsoft.com/en-us/library/aa377363(VS.85).aspx
Are you using anonymous input in your IIS configuration? If you are using Windows Authentication and follow these steps in classic ASP, you should get a logged in user:
Request.ServerVariables("LOGON_USER")
In classic ASP, you have to get the token from an external COM object.
It's been a long time since I ran into classic ASP ... but someone here who has dealt with impersonation in classic ASP might have a piece of code they can use.