473,325 Members | 2,792 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,325 software developers and data experts.

Impersonation when calling com dll

Hi.
There's a problem in asp.net I didn't find any satisfying anwser to yet.
We're using asp.net to generate a weblayout similar to our windows
clients. Thus we use a com dll which contains our application logic.
So far we have no problem.
Our Problem arises because we try to load configuration data (ini files)
in the dll. Problem is that these files don't necessarily rely on the
same machine the iis is installed on (thus it would be done by giving
the machine account read rights).
The problem we're facing is that one can enable impersonation for the
asp.net process - but unfortunately the dll is executed in another context.
As far as I analysed the problem the dll is executed using the
processModel in the machine.config file which might certainly have been
the easiest solution but in the other hand rebooting the webserver and
having then all com dlls executed using this context is not really an
option.
So my question is whether it is possible to define a certain user for
this one dll to execute. Or is there some way to impersonate the dll
with the same account as asp.net?

Thanks
Andreas

Nov 18 '05 #1
2 1719
You might want to take a look at deploying your COM DLL
into COM+. By creating a package for it through
Component Manager, it is possible to specify the identity
underwhich the DLL will be executed. There is
(generally) nothing special that needs to be done with
the DLL nor with the calling code. Performance is
impacted slightly, but that can be improved by pooling
the components (if the component is truly stateless).
But most important, the DLL can run as a different user
id.

Hope this help.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
-----Original Message-----
Hi.
There's a problem in asp.net I didn't find any satisfying anwser to yet.We're using asp.net to generate a weblayout similar to our windowsclients. Thus we use a com dll which contains our application logic.So far we have no problem.
Our Problem arises because we try to load configuration data (ini files)in the dll. Problem is that these files don't necessarily rely on thesame machine the iis is installed on (thus it would be done by givingthe machine account read rights).
The problem we're facing is that one can enable impersonation for theasp.net process - but unfortunately the dll is executed in another context.As far as I analysed the problem the dll is executed using theprocessModel in the machine.config file which might certainly have beenthe easiest solution but in the other hand rebooting the webserver andhaving then all com dlls executed using this context is not really anoption.
So my question is whether it is possible to define a certain user forthis one dll to execute. Or is there some way to impersonate the dllwith the same account as asp.net?

Thanks
Andreas

.

Nov 18 '05 #2
You might want to take a look at deploying your COM DLL
into COM+. By creating a package for it through
Component Manager, it is possible to specify the identity
underwhich the DLL will be executed. There is
(generally) nothing special that needs to be done with
the DLL nor with the calling code. Performance is
impacted slightly, but that can be improved by pooling
the components (if the component is truly stateless).
But most important, the DLL can run as a different user
id.

Hope this help.

Bruce Johnson
http://www.ObjectSharp.com/Bruce
-----Original Message-----
Hi.
There's a problem in asp.net I didn't find any satisfying anwser to yet.We're using asp.net to generate a weblayout similar to our windowsclients. Thus we use a com dll which contains our application logic.So far we have no problem.
Our Problem arises because we try to load configuration data (ini files)in the dll. Problem is that these files don't necessarily rely on thesame machine the iis is installed on (thus it would be done by givingthe machine account read rights).
The problem we're facing is that one can enable impersonation for theasp.net process - but unfortunately the dll is executed in another context.As far as I analysed the problem the dll is executed using theprocessModel in the machine.config file which might certainly have beenthe easiest solution but in the other hand rebooting the webserver andhaving then all com dlls executed using this context is not really anoption.
So my question is whether it is possible to define a certain user forthis one dll to execute. Or is there some way to impersonate the dllwith the same account as asp.net?

Thanks
Andreas

.

Nov 18 '05 #3

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

Similar topics

3
by: Vedran Furac | last post by:
I would like to run a program as another user in win2k. I have runas utility but with this I need type password all the time. Using python and windows extensions it is posibile to write a program...
12
by: Anil Krishnamurthy | last post by:
We have an ASP.NET application that uses COM objects through Interop. The web application requires access to network and database resources and hence, needs to impersonate a domain account. The...
3
by: cjk | last post by:
Issue Our web application requires access to write to a custom event log, yet access is denied. This access is denied because we are using impersonation, and our end-users do not (should not) have...
8
by: Anthony Munter | last post by:
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...
7
by: Bonj | last post by:
Hi I made a naff web application which uses the impersonation method in MSDN (can't find it now, but it basically revolves around creating a token by calling the LogonUser API, calling...
0
by: Zdenek Drlik | last post by:
Hi, I have an ASP.NET application. I want to use IsolatedStorage in this application. When I run this application with anonymous access set in IIS (user set to IUSR_<machine>) and impersonation...
0
by: velvet.graham | last post by:
I'm having a difficult time with impersonation. I've created an impersonation class. Here is the code below: ******Impersonation Class Code********* Imports System Imports System.Web.Security...
8
by: Marco Mechelli | last post by:
Hello, i'm facing with the following problem while using the Job API during an impersonation. I have a main process that needs to do the following: 1. Creates a new Job Object that will be...
0
by: ChopStickr | last post by:
I have a custom control that is embedded (using the object tag) in an html document. The control takes a path to a local client ini file. Reads the file. Executes the program specified in...
0
by: =?Utf-8?B?SmFzb24gTGluZA==?= | last post by:
Hi, I have a WCF Service hosted by a Windows Service using Impersonation. The impersonation seems to be configured correctly, in that Thread.CurrentPrinipal is the user calling the service, not the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: 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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.