Impersonation Failure - Access Denied

Discussion in 'ASP .Net' started by Andy, Jan 19, 2004.

  1. Andy

    Andy Guest

    I am new to .NET so not sure if this is the right process... Any help
    will be greatly appreciated.

    I am trying to eliminate the grey login box that pops up when Windows
    Authentication is used by using Forms Authentication and using the
    details provided to impersonate that user and supply the credentials
    to the HTTPContext.Current.User

    I have tried to use the sample code supplied by Microsoft but realised
    that I get an error (listed below) when I call impersonate method.
    Error message indicates Access denied.
    I am using Windows XP and I am using an active account but still
    encounter the problem.

    I have tried several suggestions posted on over the web unsuccessfully
    so any help will be greatly appreciated.

    Thanks in Advance,
    Andy

    -------------------ERROR---------------------------------------
    Impersonation failure.
    Description: An unhandled exception occurred during the execution of
    the current web request. Please review the stack trace for more
    information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: Impersonation failure.

    Source Error:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of
    the exception can be identified using the exception stack trace below.

    Stack Trace:


    [HttpException (0x80004005): Impersonation failure.]
    System.Web.ImpersonationSuspendContext.GetCurrentToken() +215
    System.Web.ImpersonationSuspendContext.Suspend() +53
    System.Web.HttpContext.GetConfig(String name) +104
    System.Web.Configuration.HttpCapabilitiesBase.GetConfigCapabilities(String
    configKey, HttpRequest request)
    System.Web.HttpRequest.get_Browser()
    System.Web.UI.Page.CreateHtmlTextWriterInternal(TextWriter tw,
    HttpRequest request)
    System.Web.UI.Page.CreateHtmlTextWriter(TextWriter tw)
    System.Web.UI.Page.ProcessRequestMain()




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.573;
    ASP.NET Version:1.1.4322.573
     
    Andy, Jan 19, 2004
    #1
    1. Advertising

  2. The grey login box pops up when you have basic authentication enabled in
    IIS. You stop this by enabling Anonymous or using windows integrated auth.
    Is this the article you were using?
    306158 INFO: Implementing Impersonation in an ASP.NET Application
    http://support.microsoft.com/?id=306158

    Thank you,
    John Soulis
    Microsoft, ASP.NET

    This posting is provided "AS IS", with no warranties, and confers no rights.
    Use of included script samples are subject to the terms specified at
    http://www.microsoft.com/info/cpyright.htm
     
    John Soulis [MSFT], Jan 20, 2004
    #2
    1. Advertising

  3. Andy

    Andy Guest

    Thanks John,
    I figured out what the problem was. The physical directory did not
    have NTFS permissions to Modify and Write for Everyone.

    What I am trying to do is use Forms Authentication and use the
    credentials provided by the user to validate against the Windows
    account and impersonate that user.

    This however is causing me another problem (see listing under
    Impersonation over multiple pages) which I am trying to fix now.
    Regards,
    Nasrudin.
     
    Andy, Jan 21, 2004
    #3
    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:
    0
    Views:
    409
  2. JimLad
    Replies:
    0
    Views:
    620
    JimLad
    Jan 26, 2010
  3. Petr PALAS

    Access Denied and Impersonation

    Petr PALAS, Sep 15, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    153
    Petr PALAS
    Sep 15, 2003
  4. Ryan

    Access Denied using Impersonation

    Ryan, Jan 5, 2004, in forum: ASP .Net Security
    Replies:
    2
    Views:
    120
    Holly Mazerolle
    Jan 6, 2004
  5. Jonathan Trevor
    Replies:
    2
    Views:
    220
    Jonathan Trevor
    Jul 8, 2004
Loading...

Share This Page