ASP.Net - Impersonation - Solid Example?

Posted on 2011-10-06
Last Modified: 2012-05-12
Hello all,

I am trying to really understand impersonation from the aspect of when would it be useful and a easy way to understand it.  I know I have had to enable it in certain error cases and I know when you enable it you are relying on IIS to use the client authentication VS the ASPNET account.  I am just trying to wrap my head around in what cases would you use it as it is disabled by default.
Question by:sbornstein2
    LVL 18

    Accepted Solution

    Impersonation is used when you need to executed in context of user who requested or posted the page. For example consider you want to read files from folder on server and folder has read permissions only for User1. If you will not use impersonation, then code will be executed in context of user, which does not has permissions and operation will fail. But if you use impersonation and login as User1 then code will be executed in context of User1 and operation will succeed.

    Author Closing Comment

    perfect example, thanks

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now