Network File access using anonymous access

Discussion in 'ASP .Net Security' started by Tim Menninger, Jul 22, 2004.

  1. I have seen a number of entries related to accessing remote resources (files
    in my case) that need to reside on a remote server. We must leave our files
    on a remote server due to their size. All of the solutions that I have run
    across have used impersonation with some type of windows or forms based
    security in the ASP.NET application. Our application does not require user
    authentication so we use never collect usernames and passwords. The
    application trying to access the remote resource is a webservice but I do
    not want to grant the entire web service access to the remote resource.

    Is there a way to set full access to a particular remote resource directory
    that the ASPNET user has access to or a way to specify a username and
    password at runtime when I access the remote resource?

    Thanks,

    Tim
    Tim Menninger, Jul 22, 2004
    #1
    1. Advertising

  2. Hi Tim,

    There are several ways to accomplish this, but the most secure method is
    code-level impersonation. Essentially, you call the LogonUser API and
    impersonate a user with access to the remote share. After you do your
    work, you revert to running under the ASPNET user.

    Here's an article that describes how you can do that:

    http://support.microsoft.com/default.aspx?scid=KB;EN-US;306158

    Jim Cheshire [MSFT]
    MCP+I, MCSE, MCSD, MCDBA
    Microsoft Developer Support


    This post is provided "AS-IS" with no warranties and confers no rights.

    --------------------
    >From: "Tim Menninger" <>
    >Subject: Network File access using anonymous access
    >Date: Thu, 22 Jul 2004 10:58:17 -0400
    >Lines: 18
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
    >Message-ID: <em6$cx$>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.security
    >NNTP-Posting-Host: user194.ctx.com 65.201.150.194
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.security:10909
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.security
    >
    >I have seen a number of entries related to accessing remote resources

    (files
    >in my case) that need to reside on a remote server. We must leave our files
    >on a remote server due to their size. All of the solutions that I have run
    >across have used impersonation with some type of windows or forms based
    >security in the ASP.NET application. Our application does not require user
    >authentication so we use never collect usernames and passwords. The
    >application trying to access the remote resource is a webservice but I do
    >not want to grant the entire web service access to the remote resource.
    >
    >Is there a way to set full access to a particular remote resource directory
    >that the ASPNET user has access to or a way to specify a username and
    >password at runtime when I access the remote resource?
    >
    >Thanks,
    >
    >Tim
    >
    >
    >
    Jim Cheshire [MSFT], Jul 22, 2004
    #2
    1. Advertising

  3. Tim Menninger

    Raterus Guest

    First off, you can't set permissions for the aspnet user on a remote computer, it is a computer-level account, not a domain account. Take a look at this article

    http://support.microsoft.com/default.aspx?scid=kb;en-us;306158

    You can specify a domain username/password using the second example on this page, and access the remote resource only when you need it. All the other times, the webservice won't have any access.

    --Michael

    "Tim Menninger" <> wrote in message news:em6$cx$...
    > I have seen a number of entries related to accessing remote resources (files
    > in my case) that need to reside on a remote server. We must leave our files
    > on a remote server due to their size. All of the solutions that I have run
    > across have used impersonation with some type of windows or forms based
    > security in the ASP.NET application. Our application does not require user
    > authentication so we use never collect usernames and passwords. The
    > application trying to access the remote resource is a webservice but I do
    > not want to grant the entire web service access to the remote resource.
    >
    > Is there a way to set full access to a particular remote resource directory
    > that the ASPNET user has access to or a way to specify a username and
    > password at runtime when I access the remote resource?
    >
    > Thanks,
    >
    > Tim
    >
    >
    Raterus, Jul 22, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guenther Liebowitz
    Replies:
    3
    Views:
    336
    Guenther Liebowitz
    Aug 14, 2003
  2. Kal
    Replies:
    1
    Views:
    9,502
    Kevin Spencer
    Jun 21, 2004
  3. Replies:
    5
    Views:
    4,954
  4. Reporter
    Replies:
    3
    Views:
    464
    Mike Schilling
    May 12, 2007
  5. Replies:
    1
    Views:
    212
Loading...

Share This Page