ASP.NET and Security Issues with WebClient

  • Thread starter Thread starter kellygreer1
  • Start date Start date
K

kellygreer1

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 address removed)
change nospam to yahoo
 
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!
|
*************************************************
 
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!
|

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
 
Back
Top