Impersonation Failure - Access Denied

A

Andy

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()
 
J

John Soulis [MSFT]

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
 
A

Andy

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top