File access on a UNC-path using impersonation in ASP.NET

From: Allan Thraen (allan_at_NOSPAMPLEASEmizar.dk)
Date: 05/20/03

  • Next message: brian: "Re: Role-based security in webforms"
    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


  • Next message: brian: "Re: Role-based security in webforms"

    Relevant Pages

    • RE: Access Denied on XP shared tree
      ... I have a large nuber of shared files on the server for the other two ... all of the files work fine on the server PC. ... The same shared files behave the same way on both of the client PC's. ...
      (microsoft.public.windowsxp.general)
    • Access Denied on XP shared tree
      ... I have a large nuber of shared files on the server for the other two ... all of the files work fine on the server PC. ... The same shared files behave the same way on both of the client PC's. ...
      (microsoft.public.windowsxp.general)
    • Re: nfs mount not working
      ... Modify settings or unsubscribe at: ... i reset the read write persmissions for the shared files on the server. ...
      (Ubuntu)
    • Shared Files self delete
      ... I run a small office network about 10 pc. ... We were running windows SBS ... 2 hours later "shared files gone!". ... Server, ...
      (microsoft.public.windowsxp.general)
    • Shared Files Self Delete
      ... I run a small office network about 10 pc. ... We were running windows SBS ... 2 hours later "shared files gone!". ... Server, ...
      (microsoft.public.windows.server.general)