Groups | Blog | Home
all groups > dotnet security > july 2006 >

dotnet security : Impersonation fails when loading rom third party assembly


Jeroen van Onzen
7/12/2006 9:33:01 AM
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
Jeroen van Onzen
7/13/2006 2:15:02 AM
Sorry, posted in the wrong newsgroup. Posting my question in aspnet.security
now.

[quoted text, click to view]
AddThis Social Bookmark Button