|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ASP.NET - Impersonation - CoInitializeSecurity, CoInitializeExThe COM Component has calls to CoInitializeEx, ConitializeSecurity etc. What Thread options and Impersonation and capabilities I have to set for these calls. Actually, I tried with the default ASPNET and impersonating the web application with local machine admin user; and I have tried with several combinations of levels in the calls. Also, I have tried using the compat attribute for the ASP.NET page. I have got a variety of errors including Access denied, Catastrophic failure(when trying to do some operation), "Security must be Initialized before Interfaces are Marshalled or Unmarshalled ....etc". I think I am missing something fundamental To be a bit more clear... * I have IIS 6.0 running. * I have Set comAuthenticationLevel ="PktPrivacy", comImpersonationLevel="Impersonate" in machine.config's processModel section. * I also created a few registry keys, based on an article I read somewhere that IIS 6.0 does not use the above 2 settings in machine.config. They are - MyComputer\HKLM\System\CurrentControlSet\Services\w3svc\Parameters: 1. CoInitializeSecurityParam = 1 (dword) 2. AuthenticationLevel = 6 3. ImpersonationLevel = 1 4. AuthenticationCapabilities = 0x00003040(12352) * I have specified compat="true" for the ASP.NET web form * I have set |identity impersonte="true" user="someprivilegeduser" password="password" /| * Now this ASP.NET code calls a MC++ class. Which makes the following calls: 1. CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); 2. CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_PKT_PRIVACY, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_DYNAMIC_CLOAKING, NULL) 3. Followed by some COM component calls. This is what happens when I run the code: 1. I get "Security must be Initialized before Interfaces are Marshalled or Unmarshalled...." error. Thanks
Error instantiating RSACryptoServiceProvider
Error from CAS Config util Custom IPrincipal and declarative security checking Newbie error on output Running programs located on server Code Access Security - User Policy Level best practice for encrypting in app Secure files on virtual Howto secure a local file? Error registering ServicedComponent |
|||||||||||||||||||||||