G
Guest
I have a web application with impersonate=â€true†in Web.config and on my own logon page I allow the user to either
- specify a userid/password for the app to impersonate when calling legacy COM objects
- or, just use the interactive user
If they choose to use the interactive option, the impersonate="true" means that the process runs under the interactiv
user (which I've confirmed works correctly). If they specify a userid/password, I impersonate that user in code via th
LogonUser/ImpersonateLoggedOnUser API's. This too works
When using the interactive option the COM object is correctly instantiated under the interactive user and can be called
BUT, if a user is specifically impersonated (even the same one as was available as interactive), object instantiation fails on "Type.GetTypeFromProgID(sObj, true)" with an “invalid class string†exception. The class string is the same one tha
succeeded previously
Note the following
- setting AspCompat=“true†on the page doing the impersonation and COM object creation as per the “ASP.Ne
MTA calling STA COM object access denied†problem doesn't alter behaviour
- doesn’t matter if the COM object is in a COM+ package under a particular userid/password or outside of COM+
- using different API's (LogonUser/DuplicateToken/WindowsIdentity.Impersonate) to perform impersonatio
doesn’t affect the problem. In all cases impersonation succeeds
- doesn’t matter if the ASPNET user is admin on the machine or is set to ‘Act as part of OS’ via Local Policy (whic
isn’t required on WinXP anyway)
- doesn’t matter if impersonation and COM object creation is attempted in Page_ events or not
Finally, changing to impersonate=“false†in Web.config allows COM object creation to succeed when impersonation i
requested (as opposed to above). It also works in interactive mode, however the user in this case stays as ASPNE
which is not much good for the purposes of this particular application
IS there any other reason that COM object creation is still failing when impersonate="true" and I try to impersonat
another userid/password in code? Are there workarounds for the situation? The options I've tried above were suggested b
other posts in this forum
Anthony
- specify a userid/password for the app to impersonate when calling legacy COM objects
- or, just use the interactive user
If they choose to use the interactive option, the impersonate="true" means that the process runs under the interactiv
user (which I've confirmed works correctly). If they specify a userid/password, I impersonate that user in code via th
LogonUser/ImpersonateLoggedOnUser API's. This too works
When using the interactive option the COM object is correctly instantiated under the interactive user and can be called
BUT, if a user is specifically impersonated (even the same one as was available as interactive), object instantiation fails on "Type.GetTypeFromProgID(sObj, true)" with an “invalid class string†exception. The class string is the same one tha
succeeded previously
Note the following
- setting AspCompat=“true†on the page doing the impersonation and COM object creation as per the “ASP.Ne
MTA calling STA COM object access denied†problem doesn't alter behaviour
- doesn’t matter if the COM object is in a COM+ package under a particular userid/password or outside of COM+
- using different API's (LogonUser/DuplicateToken/WindowsIdentity.Impersonate) to perform impersonatio
doesn’t affect the problem. In all cases impersonation succeeds
- doesn’t matter if the ASPNET user is admin on the machine or is set to ‘Act as part of OS’ via Local Policy (whic
isn’t required on WinXP anyway)
- doesn’t matter if impersonation and COM object creation is attempted in Page_ events or not
Finally, changing to impersonate=“false†in Web.config allows COM object creation to succeed when impersonation i
requested (as opposed to above). It also works in interactive mode, however the user in this case stays as ASPNE
which is not much good for the purposes of this particular application
IS there any other reason that COM object creation is still failing when impersonate="true" and I try to impersonat
another userid/password in code? Are there workarounds for the situation? The options I've tried above were suggested b
other posts in this forum
Anthony