WindowsImpersonationContext

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

  1. Sorin Sandu

    Sorin Sandu Guest

    This code is valid only for current page ?
    WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
    WindowsImpersonationContext impersonatedUser = newId.Impersonate();
    After I impersonate current user and Response.Redirect to another page there
    WindowsIdentity is changed to user before Impersonate.
    Is it normal ?
    How can I do to maintain Impersonation to all my pages ?
     
    Sorin Sandu, Aug 12, 2004
    #1
    1. Advertising

  2. Sorin Sandu

    tma Guest

    See if these two articles don't help.

    http://msdn.microsoft.com/msdnmag/issues/02/04/ASPSec/default.aspx
    http://msdn.microsoft.com/msdnmag/issues/02/05/ASPSec2/

    "Sorin Sandu" <> wrote in message
    news:...
    > This code is valid only for current page ?
    > WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
    > WindowsImpersonationContext impersonatedUser = newId.Impersonate();
    > After I impersonate current user and Response.Redirect to another page

    there
    > WindowsIdentity is changed to user before Impersonate.
    > Is it normal ?
    > How can I do to maintain Impersonation to all my pages ?
    >
    >
     
    tma, Aug 12, 2004
    #2
    1. Advertising

  3. Sorin Sandu

    Scott Allen Guest

    Have you investigated using impersonate=true in web.config?

    --
    Scott
    http://www.OdeToCode.com

    On Thu, 12 Aug 2004 16:16:45 +0300, "Sorin Sandu"
    <> wrote:

    >This code is valid only for current page ?
    >WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
    >WindowsImpersonationContext impersonatedUser = newId.Impersonate();
    >After I impersonate current user and Response.Redirect to another page there
    >WindowsIdentity is changed to user before Impersonate.
    >Is it normal ?
    >How can I do to maintain Impersonation to all my pages ?
    >
     
    Scott Allen, Aug 12, 2004
    #3
  4. Sorin Sandu

    Sorin Sandu Guest

    Yes I have impersonate=true
    "Scott Allen" <bitmask@[nospam].fred.net> a scris în mesajul de
    stiri:...
    > Have you investigated using impersonate=true in web.config?
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Thu, 12 Aug 2004 16:16:45 +0300, "Sorin Sandu"
    > <> wrote:
    >
    >>This code is valid only for current page ?
    >>WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
    >>WindowsImpersonationContext impersonatedUser = newId.Impersonate();
    >>After I impersonate current user and Response.Redirect to another page
    >>there
    >>WindowsIdentity is changed to user before Impersonate.
    >>Is it normal ?
    >>How can I do to maintain Impersonation to all my pages ?
    >>

    >
     
    Sorin Sandu, Aug 13, 2004
    #4
  5. 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 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.


    "Scott Allen" <bitmask@[nospam].fred.net> a scris în mesajul de
    stiri:...
    > Have you investigated using impersonate=true in web.config?
    >
    > --
    > Scott
    > http://www.OdeToCode.com
    >
    > On Thu, 12 Aug 2004 16:16:45 +0300, "Sorin Sandu"
    > <> wrote:
    >
    >>This code is valid only for current page ?
    >>WindowsIdentity newId = new WindowsIdentity(dupeTokenHandle);
    >>WindowsImpersonationContext impersonatedUser = newId.Impersonate();
    >>After I impersonate current user and Response.Redirect to another page
    >>there
    >>WindowsIdentity is changed to user before Impersonate.
    >>Is it normal ?
    >>How can I do to maintain Impersonation to all my pages ?
    >>

    >
     
    Sorin Sandu, Aug 13, 2004
    #5
  6. Sorin Sandu

    ghinta

    Joined:
    Aug 29, 2007
    Messages:
    1
    Hi guys seems an old 3d then....some1 got a resolution about it? i'm in the same problem, i do impersonate but when i do redirect i lost this impersonation....
     
    ghinta, Aug 29, 2007
    #6
    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. Replies:
    1
    Views:
    339
    Joe Kaplan
    Nov 16, 2006
Loading...

Share This Page