Impersonate a user

Discussion in 'ASP .Net' started by Sorin Sandu, Aug 16, 2004.

  1. Sorin Sandu

    Sorin Sandu Guest

    I am trying to impersonate the windows account in code like in
    http://support.microsoft.com/default.aspx?scid=kb;en-us;306158 and then all
    aspx pages to run on this new account (ACL on files is only for this
    account).
    But after the first page when I impersonate it and I redirect to another
    page the account reverse to original.
    How can I do to maintain impersonation but in code not in web.config.
    Sorin Sandu, Aug 16, 2004
    #1
    1. Advertising

  2. How are you doing the redirect? If its using Response.Redirect then the
    impersonation context will be lost (which is what I am assuming you are
    doing). You can get around this by probably doing a Server.Transfer or
    Server.Execute on the page while in the context of the impersonated user.
    Once the response goes back to the client, you will lose that impersonation
    context though.

    --
    - Paul Glavich
    Microsoft MVP - ASP.NET


    "Sorin Sandu" <> wrote in message
    news:...
    > I am trying to impersonate the windows account in code like in
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;306158 and then

    all
    > aspx pages to run on this new account (ACL on files is only for this
    > account).
    > But after the first page when I impersonate it and I redirect to another
    > page the account reverse to original.
    > How can I do to maintain impersonation but in code not in web.config.
    >
    >
    Paul Glavich [MVP - ASP.NET], Aug 16, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ajamrozek

    Impersonate NT user from Anonymous login

    ajamrozek, Feb 3, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    604
    ajamrozek
    Feb 4, 2005
  2. =?Utf-8?B?cmljaGk=?=

    Impersonate User asp.net

    =?Utf-8?B?cmljaGk=?=, Oct 11, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    4,180
    Valeriy Kirshin
    Aug 24, 2007
  3. billiejoex
    Replies:
    6
    Views:
    691
    billiejoex
    Aug 23, 2007
  4. Giampaolo Rodola'

    Impersonate another user (Guest) on Windows

    Giampaolo Rodola', Mar 24, 2008, in forum: Python
    Replies:
    0
    Views:
    813
    Giampaolo Rodola'
    Mar 24, 2008
  5. Bill Belliveau

    DirectoryEntry Impersonate or WindowsIdentity Impersonate?

    Bill Belliveau, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    3
    Views:
    328
    Joe Kaplan \(MVP - ADSI\)
    Jan 31, 2004
Loading...

Share This Page