PC Review


Reply
Thread Tools Rate Thread

ASP.NET and Security Issues with WebClient

 
 
kellygreer1
Guest
Posts: n/a
 
      4th Mar 2008
I have a ASP.NET WebSite running on IIS6 on Windows 2003.
I'd like to have the Default.aspx page be able to web scrape a page
from the same site "data.ashx".
I'd like to keep everything NT Authentication.

Nothing I try seems to work. I always get a 401 authorization error.
Here is what I have tried.
1) WebClient
2) WebClient + new Credentials
3) WebClient + Impersonation in web.config
4) Application Pool with Network Identity - and then I get Service
Unavailable on my site.

Help!

What is the correct way to do this? Either a WebClient call or a Soap
call to the same server or remote with NT Authentication. I can't
seem to figure out why I get the 401 error and no idea how to
troubleshoot or solve.

Thanks,
Kelly Greer
(E-Mail Removed)
change nospam to yahoo
 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      5th Mar 2008
I have not attempted anything like this with an ashx. I have used asmx files
in the same project (as an experiment, as I see no reason to involve the
HTTP stack for something that is local (If I needed both in the same
project, the ASMX would be used remote and the class files locally).

WIth your project, I assume the ASHX has a purpose for external clients. If
not, I would not keep it as your data access method. Even if so, I would
refactor the actual data access methods to a class rather than leave in the
ASHX and call this class directly for local access of the data. It makes it
easier to unit test, as well.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
"kellygreer1" <(E-Mail Removed)> wrote in message
news:9175e7dc-af27-4782-96b6-(E-Mail Removed)...
>I have a ASP.NET WebSite running on IIS6 on Windows 2003.
> I'd like to have the Default.aspx page be able to web scrape a page
> from the same site "data.ashx".
> I'd like to keep everything NT Authentication.
>
> Nothing I try seems to work. I always get a 401 authorization error.
> Here is what I have tried.
> 1) WebClient
> 2) WebClient + new Credentials
> 3) WebClient + Impersonation in web.config
> 4) Application Pool with Network Identity - and then I get Service
> Unavailable on my site.
>
> Help!
>
> What is the correct way to do this? Either a WebClient call or a Soap
> call to the same server or remote with NT Authentication. I can't
> seem to figure out why I get the 401 error and no idea how to
> troubleshoot or solve.
>
> Thanks,
> Kelly Greer
> (E-Mail Removed)
> change nospam to yahoo



 
Reply With Quote
 
kellygreer1
Guest
Posts: n/a
 
      5th Mar 2008
On Mar 5, 10:19 am, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
> I have not attempted anything like this with an ashx. I have used asmx files
> in the same project (as an experiment, as I see no reason to involve the
> HTTP stack for something that is local (If I needed both in the same
> project, the ASMX would be used remote and the class files locally).
>
> WIth your project, I assume the ASHX has a purpose for external clients. If
> not, I would not keep it as your data access method. Even if so, I would
> refactor the actual data access methods to a class rather than leave in the
> ASHX and call this class directly for local access of the data. It makes it
> easier to unit test, as well.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> *************************************************
> | Think outside the box!
> |
> *************************************************"kellygreer1" <kellygre...@yahoo.com> wrote in message
>
> news:9175e7dc-af27-4782-96b6-(E-Mail Removed)...
>
> >I have a ASP.NET WebSite running on IIS6 on Windows 2003.
> > I'd like to have the Default.aspx page be able to web scrape a page
> > from the same site "data.ashx".
> > I'd like to keep everything NT Authentication.

>
> > Nothing I try seems to work. I always get a 401 authorization error.
> > Here is what I have tried.
> > 1) WebClient
> > 2) WebClient + new Credentials
> > 3) WebClient + Impersonation in web.config
> > 4) Application Pool with Network Identity - and then I get Service
> > Unavailable on my site.

>
> > Help!

>
> > What is the correct way to do this? Either a WebClient call or a Soap
> > call to the same server or remote with NT Authentication. I can't
> > seem to figure out why I get the 401 error and no idea how to
> > troubleshoot or solve.

>
> > Thanks,
> > Kelly Greer
> > kellygre...@nospam.com
> > change nospam to yahoo


It has an external purpose only.
I was experimenting with some REST (ROA) concepts.

I do the same when doing asmx.... I just use the class when working
locally.

Ran into same kind of issue again today on Windows 2003 ...Two sub-
sites - one an application / the other a web service
Both virtual directories - set as applications with anonymous client
access.
When the App calls the Web Service I get a 401 error. Arghhh!!!
I thought it was anonymous authentication? Can someone else try this
out and tell me I'm not crazy?
I was using a WCF-based .svc service here.

Thanks,
Kelly
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
WebDAV-Redirector/WebClient-Service: Error Messages, Upload issues Michael Beurskens Windows Vista Networking 0 10th Sep 2007 02:15 PM
File Upload issues with WebClient.UploadFile Phillip N Rounds Microsoft ASP .NET 1 2nd Feb 2006 09:13 PM
MSN site requesting Social Security Num - a valid explanation is needed - vital security issues mgm Windows XP Help 0 26th Mar 2005 12:16 AM
Webclient svc & tmieout issues. WS Windows XP General 0 27th Jun 2004 10:35 PM
WebClient DownloadFile gets ALL files in directory?!? WebClient bug? Jeremy Microsoft Dot NET Framework 1 10th Nov 2003 01:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:26 AM.