File access on a UNC-path using impersonation in ASP.NET
From: Allan Thraen (allan_at_NOSPAMPLEASEmizar.dk)
Date: 05/20/03
- Previous message: Andrew: "Thread & redirect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 20 May 2003 14:48:00 -0700
Hi,
This is my problem:
I have an asp.net page (in c#) that I want to be able to link to a number of
shared files, if the user looking at the page has access to them.
The way I planned to check this was to let the page impersonate the user,
and then try a File.Exist on the various unc-paths.
I have set <identity impersonate="true"/> in the web.config and I have made
sure that anonymous access is not allowed.
However this only works when I call the page from the server it is located
on, calling it as "localhost/mypage.aspx". If I call it from anywhere else,
the File.Exist will return false - even if its files I have access to. Even
calling it as "127.0.0.1/mypage.aspx" from the server won't work.
I've tried to output both the User.Identity and the
System.Security.Principal.WindowsIdentity.GetCurrent().Name. This is the
correct username both when run on the server and also called from a browser
on another machine.
I've also tried to output the authentication method. Using localhost it
usually returns "NTLM", and from another machine it usually returns
"Negotiated".
Any advice you could give me would be appreciated, since I'm pretty stuck
right now.
/Allan Thraen
- Previous message: Andrew: "Thread & redirect"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|