gaining access to a share

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default gaining access to a share

    Hi,

    I want to create a folder on a network share from within
    my ASP.NET application. The app uses a custom
    authentication mechanism which creates a Principal object
    after looking up an external system.

    It seems whenever the Directory.CreateDirectory() method
    executes I get an UnauthorizedAccessException exception. I
    suspect this is because the ASPNET account is a local
    account which is unknown to the computer where the share
    resides.

    How can I progamatically gain access to that share to
    create the dir?

    I do not want to configure impersonation in the web.config
    as I fear this is less secure.

    Thanks, Lachlan
    Lachlan James Guest

  2. Similar Questions and Discussions

    1. Access Windows Share In Ubuntu
      I am logged in as root I have a whole partition shared on windows called "MEDIA" the windows box has an ip of 192.168.1.10 Ubuntu Box is ...
    2. Can I share an Access MDW file for security.
      Hi all, I am trying to set up a web application to connect to an old Access 97 database. The database uses a workgroup.mdw workgroup file for its...
    3. unable to access share
      I was called by a client last week, who said he was unable to access the server. The network is mixed apple (osx and os9), windows 2000 and windows...
    4. folder access in share
      In article <un6Zq$9RDHA.3768@tk2msftngp13.phx.gbl>, "WILLIAM WELBORN" <bwelborn707@email.uophx.edu> wrote: That message is very misleading. The...
    5. XP User not able to access $ share
      I would assume that you have correctly configured all the machines. If not, maybe that's where the problem is. Try making a new connection. You can...
  3. #2

    Default Re: gaining access to a share

    On Mon, 14 Feb 2005 08:04:42 -0800, "Lachlan James" <anonymous@discussions.microsoft.com> wrote:

    ¤ Hi,
    ¤
    ¤ I want to create a folder on a network share from within
    ¤ my ASP.NET application. The app uses a custom
    ¤ authentication mechanism which creates a Principal object
    ¤ after looking up an external system.
    ¤
    ¤ It seems whenever the Directory.CreateDirectory() method
    ¤ executes I get an UnauthorizedAccessException exception. I
    ¤ suspect this is because the ASPNET account is a local
    ¤ account which is unknown to the computer where the share
    ¤ resides.
    ¤
    ¤ How can I progamatically gain access to that share to
    ¤ create the dir?
    ¤
    ¤ I do not want to configure impersonation in the web.config
    ¤ as I fear this is less secure.

    You need to understand how delegation works so you can choose which authentication method best suits
    your configuration:

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconaspnetdelegation.asp[/url]
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;810572[/url]


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

  4. #3

    Default Re: gaining access to a share

    Hi Paul,

    Thanks for your reply. Unfortunately we are using a custom
    authentication system for this particular application
    because the built in ones don't fulfil our needs. This
    means using windows authentication & impersonation is not
    possible. Besides that, it is not recommended to do it
    that way for security reasons.

    However towards the end of the article you posted it
    mentioned using COM+ serviced components to achieve this,
    so that's what I have done. I have a serviced component
    which I call from my asp.net app. The serviced component
    runs under a custom account which has access to the
    network share. This is the easiest & most secure way to do
    this I think.

    For anyone else that is interested in doing this, below is
    a great article which explains how to do it and why it is
    the only viable option.

    [url]http://www.15seconds.com/issue/030926.htm[/url]

    Lachlan

    >-----Original Message-----
    >On Mon, 14 Feb 2005 08:04:42 -0800, "Lachlan James"
    <anonymous@discussions.microsoft.com> wrote:
    >
    >¤ Hi,

    >¤ I want to create a folder on a network share from
    within
    >¤ my ASP.NET application. The app uses a custom
    >¤ authentication mechanism which creates a Principal
    object
    >¤ after looking up an external system.

    >¤ It seems whenever the Directory.CreateDirectory()
    method
    >¤ executes I get an UnauthorizedAccessException
    exception. I
    >¤ suspect this is because the ASPNET account is a local
    >¤ account which is unknown to the computer where the
    share
    >¤ resides.

    >¤ How can I progamatically gain access to that share to
    >¤ create the dir?

    >¤ I do not want to configure impersonation in the
    web.config
    >¤ as I fear this is less secure.
    >
    >You need to understand how delegation works so you can
    choose which authentication method best suits
    >your configuration:
    >
    >[url]http://msdn.microsoft.com/library/default.asp?[/url]
    url=/library/en-us/vsent7/html/vxconaspnetdelegation.asp
    >[url]http://support.microsoft.com/default.aspx?scid=kb;en-[/url]
    us;810572
    >
    >
    >Paul ~~~ [email]pclement@ameritech.net[/email]
    >Microsoft MVP (Visual Basic)
    >.
    >
    Lachlan James Guest

  5. #4

    Default Re: gaining access to a share

    On Tue, 15 Feb 2005 03:36:08 -0800, "Lachlan James" <anonymous@discussions.microsoft.com> wrote:

    ¤ Hi Paul,
    ¤
    ¤ Thanks for your reply. Unfortunately we are using a custom
    ¤ authentication system for this particular application
    ¤ because the built in ones don't fulfil our needs. This
    ¤ means using windows authentication & impersonation is not
    ¤ possible. Besides that, it is not recommended to do it
    ¤ that way for security reasons.
    ¤
    ¤ However towards the end of the article you posted it
    ¤ mentioned using COM+ serviced components to achieve this,
    ¤ so that's what I have done. I have a serviced component
    ¤ which I call from my asp.net app. The serviced component
    ¤ runs under a custom account which has access to the
    ¤ network share. This is the easiest & most secure way to do
    ¤ this I think.
    ¤
    ¤ For anyone else that is interested in doing this, below is
    ¤ a great article which explains how to do it and why it is
    ¤ the only viable option.
    ¤
    ¤ [url]http://www.15seconds.com/issue/030926.htm[/url]
    ¤
    ¤ Lachlan

    Yes I still use this type of mechanism for ASP and Visual Basic 6.0 components, although I kind of
    moved away from COM+ since I moved to .NET.


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139