Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > XmlUrlResolver not working right

Reply
Thread Tools

XmlUrlResolver not working right

 
 
David Thielen
Guest
Posts: n/a
 
      12-22-2006
I have a test http url that allows a connection from any domain user.

I am using the following code to test access to it:
XmlReaderSettings readerSettings = new XmlReaderSettings();
readerSettings.ProhibitDtd = false;
readerSettings.ValidationType = ValidationType.DTD;
XmlUrlResolver resolver = new XmlUrlResolver();
resolver.Credentials = new NetworkCredential("dave", "bogus");
readerSettings.XmlResolver = resolver;
XmlReader xmlReader = XmlReader.Create(filename, readerSettings);
while (xmlReader.Read())
// nothing - just make sure can read all
;

But the above is a bad password. Shouldn't this fail? I am testing this case
because we can use forms login and in that case the user must enter their
username/password - we don't want to allow the credentials of the ASP.NET app
to allow access.

Am I missing something?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      12-25-2006
Hello Dave,

I think the problem you meet is is due to the server-side web
application/page is using Forms Authentication, the httpwebrequest based
programmatic http web requesting does not support interactive with forms
authentication. Forms Authentication always require an interactive client
user. There does exists means to programmatically request pages secured
through forms authentication, you can construct a http post message with
the username/password forms data pair and send it to the login page, after
that hold the returned cookie collection so that you can use httpwebrequest
to access other pages secured by the forms authentication later. here is a
good web article demonstrate on this:

http://odetocode.com/Articles/162.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
 
David Thielen
Guest
Posts: n/a
 
      12-30-2006
I forgot to turn off all anonomous connections - works fine now.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"Steven Cheng[MSFT]" wrote:

> Hello Dave,
>
> I think the problem you meet is is due to the server-side web
> application/page is using Forms Authentication, the httpwebrequest based
> programmatic http web requesting does not support interactive with forms
> authentication. Forms Authentication always require an interactive client
> user. There does exists means to programmatically request pages secured
> through forms authentication, you can construct a http post message with
> the username/password forms data pair and send it to the login page, after
> that hold the returned cookie collection so that you can use httpwebrequest
> to access other pages secured by the forms authentication later. here is a
> good web article demonstrate on this:
>
> http://odetocode.com/Articles/162.aspx
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Menu Items is not right aligned with Right to Left documen =?Utf-8?B?QmlzaG95?= ASP .Net 0 12-28-2006 11:39 AM
Tool to enable Right click on pages where Right click is disabled tsteinke@gmail.com Computer Support 4 08-28-2005 11:53 PM
XmlUrlResolver xsl:include Gideon de Swardt ASP .Net 6 03-01-2004 03:20 PM
ASP.NET Impersonation, XmlUrlResolver, and DefaultCredentials Colin Bowern ASP .Net Security 0 01-02-2004 09:45 PM
pass the right form input to the right control Tom ASP .Net 0 12-11-2003 03:07 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57