Accessing shares on other servers

M

Mantorok

Hi

I have an app and during some code-behind it attempts to fetch some files
from another server-share, IIS is configured to use the users windows-login
as authentication and although we have access to this share on the other
server an exception is thrown, the app says "Access Denied" and waffles on
about giving the ASPNET machine account access to the share - but we don't
need to do this as we are using windows authentication.

Any ideas? I'm confused.

Kev
 
S

S.M. Altaf [MVP]

Kev,

You may be using Windows Authentication, but when your ASP.NET application
attempts to access those files, it does so under the security context of the
ASP.NET worker process. What you need to do is to set user impersonation in
your ASP.NET application so that the application runs under the security
context of the person who is using it.

Open up your web.config file, and change the impersonate tag to look like
this:

<identity impersonate="true" />


Read more about impersonation on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconImpersonation.asp

HTH,
S.M. Altaf
[MVP - VB]
 
B

Bruce Barker

this will not work unless you are using kerberos and enable creditials
forwarding.

this is due to the 1 hop rule, as asp.net does not have the users primary
token, so it can access networks services.

-- bruce (sqlwork.com)



S.M. Altaf said:
Kev,

You may be using Windows Authentication, but when your ASP.NET application
attempts to access those files, it does so under the security context of
the ASP.NET worker process. What you need to do is to set user
impersonation in your ASP.NET application so that the application runs
under the security context of the person who is using it.

Open up your web.config file, and change the impersonate tag to look like
this:

<identity impersonate="true" />


Read more about impersonation on MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconImpersonation.asp

HTH,
S.M. Altaf
[MVP - VB]

--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com


Mantorok said:
Hi

I have an app and during some code-behind it attempts to fetch some files
from another server-share, IIS is configured to use the users
windows-login as authentication and although we have access to this share
on the other server an exception is thrown, the app says "Access Denied"
and waffles on about giving the ASPNET machine account access to the
share - but we don't need to do this as we are using windows
authentication.

Any ideas? I'm confused.

Kev
 

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

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top