Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Impersonation fails when loading rom third party assembly

Reply
Thread Tools

Impersonation fails when loading rom third party assembly

 
 
Jeroen van Onzen
Guest
Posts: n/a
 
      07-13-2006
Hi guys,

I posted this question first in the wrong newsgroup (.net.security), but
this is an asp.net question (i guess). Sorry ...


I am developing a web application. When I try to connect to an Analysis
Services 2005 server everything works fine. When I try to connect to an
Analysis Services by an assembly which i load an exception occurs.

There should be a blog or a newsgroup entry somewehere of this problem, but
i didn't find it. Sorry, but after discovering this bug (took a while) I
probably narrowed my focus too small.

When loading the assembly in a strandard .Net application everything works
fine.

How can I solve this problem?????

With regards,

Jeroen van Onzen

In Web.Config this line:
<authentication mode="Windows"/>
<identity impersonate="false"/>

protected void Page_Load(object sender, EventArgs e)
{
string currentUserNameDebug = WindowsIdentity.GetCurrent().Name; //returns
my ASP.Net account
WindowsImpersonationContext context =
((WindowsIdentity)HttpContext.Current.User.Identit y).Impersonate();
//impersonating
currentUserNameDebug = WindowsIdentity.GetCurrent().Name; //returns
my Windows account

// trying to setup a normal Adomdconnection
AdomdConnection connection = new AdomdConnection();
connection.ConnectionString = "Data Source=" + "wally" + ";"; //this is
another machine
connection.Open(); //connection opens, when tracing(using the Profiler) I
see a new connection
connection.Close();

//trying to setup a normal Adomdconnection by a third-party assembly
ThirdParty.Control.AnalysisServices.Report report = new
ThirdParty.Control.AnalysisServices.Report();
report.ConnectionString = "Data Source=" + "wally" + ";";
report.Connect(); //connection fails, profiler shows the NT Authority
Network Account
report.Disconnect();

context.Undo(); //undo impersonate
currentUserNameDebug = WindowsIdentity.GetCurrent().Name; //returns
correct name
}

 
Reply With Quote
 
 
 
 
Matthew Roebuck
Guest
Posts: n/a
 
      07-14-2006
Jeroen -

It is a little difficult to read your code but it appears that you have
impersonate set to false in your web.config file. When your code attempts to
instantiate the COM object, what type of exception is being thrown? I am
fairly certain that your code is attempting to instantiate the COM object
under the restricted access user ASP.NET code executes under normally and
probably doesn't have the required permissions. What happens when you set
impersonate attribute to true?

Good luck,
Matthew Roebuck
 
Reply With Quote
 
 
 
 
Jeroen van Onzen
Guest
Posts: n/a
 
      07-14-2006
Matthew,

thanks for your response. I finally discovered the problem, the third party
component is lauching a seperate thread. Thanks all for looking to my
problem.

Sorry

Jeroen



"Matthew Roebuck" wrote:

> Jeroen -
>
> It is a little difficult to read your code but it appears that you have
> impersonate set to false in your web.config file. When your code attempts to
> instantiate the COM object, what type of exception is being thrown? I am
> fairly certain that your code is attempting to instantiate the COM object
> under the restricted access user ASP.NET code executes under normally and
> probably doesn't have the required permissions. What happens when you set
> impersonate attribute to true?
>
> Good luck,
> Matthew Roebuck

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exception occured While loading dynamically EXE assembly in C++/CLI(Could not load file or assembly ', Version=1.0.3836.39802, Culture=neutral,PublicKeyToken=null' ...) glitteringsounds C++ 1 07-03-2010 07:49 PM
Connecting Third Party Wireless Device to Livebox using Windows XP =?Utf-8?B?VHJhY3k=?= Wireless Networking 2 12-05-2005 07:22 PM
Referencing assembly from GAC using @assembly fails Brent ASP .Net 1 01-23-2004 08:23 PM
Improved third-party (preferably free) scroll bar Kieran Benton ASP .Net 3 09-11-2003 02:38 AM
Strange error when calling third party assembly Mikael Engdahl ASP .Net 0 08-08-2003 12:02 AM



Advertisments