Skip to Content
0
Former Member
Feb 14, 2011 at 05:51 PM

User Impersonation in Thick Client .Net Application

29 Views

Greetings,

Built a thick client application using Visual Studio 2008, C#, Crystal 2008 SP3 FP3.3. All works as expected.

I would like to add user impersonation. That is, for security reasons, I would like the software to impersonate another user. I know how to do this, and I impersonate the user before the report is loaded, and turnoff the impersonation after the report is loaded.

Exception is "Load report failed."

Stack Trace

  at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)
  at CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename)
  at ReportComponents.ReportDoc.threadOpen_DoWork(Object sender, DoWorkEventArgs e)

Inner exception is "Access is denied. \r"

Stack trace:

  at CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options)
  at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options)
  at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened()

It is a permissions problem.

So, it doesn't seem like user impersonation is supported.

Question: Is user impersonation supported in any version of the Crystal .Net runtime for thick client applications? If so, what versions?

Question: Is there a work around for this error. Is there another way around?

Everything works fine without user impersonation. Just want to know if and how user impersonation works with Crystal .Net. Any samples would be greatly appreciated.