Click here to Skip to main content
15,896,428 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to catch page not found error when redirecting Pin
DotNetXenon30-Apr-08 8:42
DotNetXenon30-Apr-08 8:42 
AnswerRe: How to catch page not found error when redirecting Pin
Blue_Boy30-Apr-08 10:31
Blue_Boy30-Apr-08 10:31 
AnswerRe: How to catch page not found error when redirecting Pin
Sankar Komma 30-Apr-08 10:41
Sankar Komma 30-Apr-08 10:41 
Question[c#] read a table from a web page Pin
Joshua8230-Apr-08 8:22
Joshua8230-Apr-08 8:22 
AnswerRe: [c#] read a table from a web page Pin
Christian Graus30-Apr-08 10:51
protectorChristian Graus30-Apr-08 10:51 
AnswerRe: [c#] read a table from a web page Pin
Colin Angus Mackay30-Apr-08 13:56
Colin Angus Mackay30-Apr-08 13:56 
GeneralRe: [c#] read a table from a web page Pin
Joshua8230-Apr-08 22:41
Joshua8230-Apr-08 22:41 
Question403 Forbidden Error Due To Incorrect Impersonation Level? Pin
TGT30-Apr-08 6:23
TGT30-Apr-08 6:23 
I'm using HttpWebRequest and HttpWebResponse to query a remote server. I plan to load the returned xml into an XMLDocument, but the HttpWebRequest.GetResponse() method fails with a 403 "Forbidden" error.

I am able to get a response when I put my domain username and password as plain text into the request's Credentials member, but of course I'd like to avoid having that information in the application.

I thought that code along these lines (found at http://claytonj.wordpress.com/2006/09/04/run-code-under-the-iis-authenticated-user-context/)
would solve my problem:
using System.Security.Principal;

if (User.GetType() == typeof(WindowsPrincipal))
{
WindowsIdentity id = (WindowsIdentity) User.Identity;
WindowsImpersonationContext impersonate = id.Impersonate();


//perform tasks under the impersonated user
//*** ***//

//revert back to local ASPNET account
impersonate.Undo();
}
else
{
//user isn’t authenticated
}

But, I still get the 403 error. I think the impersonation is failing because the WindowsIdentity.ImpersonationLevel property is always "Impersonation." I think this needs to be "Delegation" to reach the remote server (I'm behind a firewall and corporate proxy), but the property is read-only so I can't set it.


My Question: What do I need to configure in order to get the ImpersonationLevel property to be of the TokenImpersonationLevel.Delegation type?

Let me know if this requires clarification.
QuestionDatabound sitemap navigation Pin
Ariel Kazeed30-Apr-08 5:04
Ariel Kazeed30-Apr-08 5:04 
QuestionCopying website ?? Pin
kindman_nb30-Apr-08 4:35
kindman_nb30-Apr-08 4:35 
AnswerRe: Copying website ?? Pin
eyeseetee30-Apr-08 5:03
eyeseetee30-Apr-08 5:03 
GeneralRe: Copying website ?? Pin
kindman_nb30-Apr-08 5:08
kindman_nb30-Apr-08 5:08 
QuestionSending mail from the default email client - problem Pin
lune1230-Apr-08 4:21
lune1230-Apr-08 4:21 
AnswerRe: Sending mail from the default email client - problem Pin
i gr830-Apr-08 9:12
i gr830-Apr-08 9:12 
AnswerRe: Sending mail from the default email client - problem Pin
Christian Graus30-Apr-08 10:54
protectorChristian Graus30-Apr-08 10:54 
QuestionRe: Sending mail from the default email client - problem Pin
lune1230-Apr-08 20:48
lune1230-Apr-08 20:48 
AnswerRe: Sending mail from the default email client - problem Pin
Christian Graus30-Apr-08 23:15
protectorChristian Graus30-Apr-08 23:15 
QuestionRe: Sending mail from the default email client - problem Pin
lune121-May-08 1:32
lune121-May-08 1:32 
AnswerRe: Sending mail from the default email client - problem Pin
Christian Graus1-May-08 3:00
protectorChristian Graus1-May-08 3:00 
QuestionSession Timeout Problem ....Pls Help Pin
koolprasad200330-Apr-08 3:49
professionalkoolprasad200330-Apr-08 3:49 
AnswerRe: Session Timeout Problem ....Pls Help Pin
N a v a n e e t h30-Apr-08 3:57
N a v a n e e t h30-Apr-08 3:57 
AnswerRe: Session Timeout Problem ....Pls Help Pin
Guffa30-Apr-08 4:12
Guffa30-Apr-08 4:12 
JokeRe: Session Timeout Problem ....Pls Help Pin
CPallini30-Apr-08 7:34
mveCPallini30-Apr-08 7:34 
Questionshow drop downlist values on mouseover Pin
gottimukkala30-Apr-08 3:14
gottimukkala30-Apr-08 3:14 
AnswerRe: show drop downlist values on mouseover Pin
squattyarun30-Apr-08 3:16
squattyarun30-Apr-08 3:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.