Windows authentication with impersonation - network resource access fails

  • Thread starter srivalli chavali via DotNetMonster.com
  • Start date
S

srivalli chavali via DotNetMonster.com

Hi,

I have a question regd. Windows authentication and network file access.
My asp.net application doesn't use any of the .NET's authentication schemes
(Forms, Windows or Passport) yet.
I have a login page where the users would supply their credentials and the
business logic compares these

credentials against SQLServer database and allows/denies access to the
website.
So far so good.

But now, my application needs to access some files located on the Domain
network.
The first thing that came in my mind is Impersonation.

I did change my web.config file to use Windows authentication as follows...

<authentication mode="Windows" />

<authorization>
<allow users="*" />
</authorization>

<identity impersonate="true"
userName="domainName\loginID"
password="password"
/>

This "domainName\loginID" account HAS full rights over the network resource.

Now I have UNCHECKED Allow Anonymous Access in IIS.

But I still cannot access the file on the network.

It errors out at the Response.Redirect
("//networkPath/folder1/subFolder1/fileName");
as Page cannot be displayed.

I have checked the User.Identity.Name and it looks correct (domainName\
loginID)
Even the User.Identity.AuthenticationType is good (NTLM)

I'm surely missing something critical.

Any help in this regards is greatly appreciated.

Thanks in advance,
Srivalli.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Two things.
1- When you run a process as a service you need to use the UNC , like
\\servername\path to access it
2- BY default (and I dont know if you can change this) you cannot access any
path outside the web tree, this is for security reasons so you could not
traverse the hdd.


Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top