Impersonation fails when loading rom third party assembly

Impersonation fails when loading rom third party assembly

Post by SmVyb2VuIH » Fri, 14 Jul 2006 01:33:01


Hi guys,

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.Identity).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
}
 
 
 

Impersonation fails when loading rom third party assembly

Post by SmVyb2VuIH » Fri, 14 Jul 2006 18:15:02

Sorry, posted in the wrong newsgroup. Posting my question in aspnet.security
now.