Feed Icon  


  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics


Open Source Projects



Impersonating WebPart

Posted in Reporting Services | SharePoint at Wednesday, June 30, 2004 10:07 AM Pacific Daylight Time

First an insensitive validator and next an Impersonating WebPart. What is web development coming too? :)

Jay Nathan now has a .Text blog! After you subscribe you should read his article on the Impersonating WebPart. It covers the basics of how to use the WebPart to impersonate users along with an overview of things like CAS.

If you're new to SharePoint development and you don't know what CAS stands for then you really need to read Maxim Karpov's article on the subject. Jan also talks about it in reference to the SmartPart here. While CAS is not something I really enjoy, it is essential to understand. If you don't at least understand the theory then you're going to run into real trouble the first time you get a security exception in the web part you're developing.

But back to the article. One thing that caught my attention since it is something that I've struggled with before:

Impersonator i = new Impersonator("SharePointRead", "MARINER", 

// Code requiring higher permissions...


Note: Instead of hard-coding the account credentials, they should probably be stored in the SharePoint's web.config file or a SQL Server table.

I really don't want to put the username and password in the code (as noted), but I also really don't want to put them in a database or a web.config file either. What I really want to do is figure out how to make this work with single sign-on. Unfortunately I haven't even got single sign-on running so I haven't looked at if this is possible.

Overall I think the Impersonating WebPart is a great idea and will probably cover 99% of what you would use it for. However, there are some cases (like Reporting Services) where I think you might need to have something like single sign-on in order to deal with who sees what data.

Tuesday, May 6, 2008 2:35:06 PM (Pacific Daylight Time, UTC-07:00)
Yes, you can see more about this here:,
Sunday, February 1, 2009 6:50:45 PM (Pacific Standard Time, UTC-08:00)
I have developed one webpart which shows result from sql server 2005 "Client" table. and i have deployed that webpart in WSS site. The site is created with clientid. Now i want to apply impersonation with active directory instead of using sql server database. In short i want to apply single sign on functionality on the site which shows the clients detail in that webpart.
How can i do that
Comments are closed.