Re: reading network shared directory

From: cdr (a@t)
Date: 11/20/02


From: "cdr" <chrisr a@t hawaii.rr.com>
Date: Tue, 19 Nov 2002 14:50:09 -1000


John,

I believe this is a delegation issue. If you are accessing your machine
locally using windows authentication on the IIS application then your
machine has your username in a format that it can pass onto the other
server. If you try to log on from a third machine onto your machine then
all the web server has(you machine is your login/password in hashed format,
which can't be passed onto a third server in a format that is acceptable).

Try switching your IIS application security to basic, and see if it works
then. If it does, then I bet that is the problem.

You can either set up delegation, or use basic authentication on your IIS
app. by using basic, then your login/password is sent plain text to the
webserver and is still in a form that can be hashed for authentication by
the 3rd machine.

A good solution is to user Basic authenitication on the IIS application with
httpsso the plain text transmissions are encrpyted...if you want more
security on that part.

I think this is the problem, but please let me know if not.

Chris

"John Watts" <jwatts@somewhere> wrote in message
news:Oz4ljy#jCHA.440@tkmsftngp11...
> I'm trying to read a directory listing for a network share and am getting
> access denied exceptions. I have anonymous access turned off in the IIS
> Manager, and have turned on impersonation in the web.config.
>
> If I run the application in the debugger locally, it works fine, but if I
> try to connect to my machine from another machine I get the exceptions.
The
> logged in user on the other machine has the exact same rights to the
network
> share as I do, and if we type in the path in the Start->Run window it
opens
> it up fine.
>
> Currently we are using a COM+ object we created so we can have it run as
an
> 'object user' domain account, but we really don't want to continue to do
it
> this way.
>
> We have tried seperating the code that does the DirectoryInfo calls to
it's
> own class library within the project, but that had no effect.
>
> If anyone has any ideas as to what the problem is, and a solution for the
> problem, it would be appreciated.
>
> Here's the code I'm using:
>
> public static FileInfo[] ReadDirectory(string directoryPath,string
fileMask)
> {
> FileInfo[] returnArray;
>
> try
> {
> DirectoryInfo dirInfo = new DirectoryInfo(directoryPath);
> returnArray = dirInfo.GetFiles(fileMask);
> }
> catch(Exception ex)
> {
> // Rethrow the exception
> throw(ex);
> }
>
> return(returnArray);
> }
>
>
> Thanks for any info/suggestions,
>
> John Watts
>
>



Relevant Pages