Windows authentication with impersonation - network resource access fails

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

  1. #1

    Default Windows authentication with impersonation - network resource access fails

    Hi,

    I have a question regd. Windows authentication and network file access.
    My asp.net application doesn't use any of the .NET's authentication schemes
    (Forms, Windows or Passport) yet.
    I have a login page where the users would supply their credentials and the
    business logic compares these

    credentials against SQLServer database and allows/denies access to the
    website.
    So far so good.

    But now, my application needs to access some files located on the Domain
    network.
    The first thing that came in my mind is Impersonation.

    I did change my web.config file to use Windows authentication as follows...

    <authentication mode="Windows" />

    <authorization>
    <allow users="*" />
    </authorization>

    <identity impersonate="true"
    userName="domainName\loginID"
    password="password"
    />

    This "domainName\loginID" account HAS full rights over the network resource.

    Now I have UNCHECKED Allow Anonymous Access in IIS.

    But I still cannot access the file on the network.

    It errors out at the Response.Redirect
    ("//networkPath/folder1/subFolder1/fileName");
    as Page cannot be displayed.

    I have checked the User.Identity.Name and it looks correct (domainName\
    loginID)
    Even the User.Identity.AuthenticationType is good (NTLM)

    I'm surely missing something critical.

    Any help in this regards is greatly appreciated.

    Thanks in advance,
    Srivalli.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]
    srivalli chavali via DotNetMonster.com Guest

  2. Similar Questions and Discussions

    1. OdbcConnection failed when using Windows authentication and impersonation.
      I got the error message below when I try to open a connection with code: Dim connection As New OdbcConnection("Driver={Microsoft Text Driver...
    2. How to allow my Web Application access a network resource?
      All, I have an ASP.NET application (with FormAuthentication but it shouldn't matter because I may allow unauthenticated user also). I want to...
    3. Total Confusion! - ACLs and Windows authentication with no impersonation
      Hi all, apologies if this has come up before, but I've been searching the whole day and found nothing... If I have authentication set to...
    4. ASP.NET using impersonation cannot access network shared drive
      I have a ASP.NET application with web.config specified: <identity impersonate=true/> <authentication mode="Windows" /> If I login to the client...
    5. Windows XP Pro looses network authentication
      I have a problem that I have been trying to resolve for some time but no success yet. We have a corporate network consisting of several pcs and...
  3. #2

    Default Windows authentication with impersonation - network resource access fails

    this has nothing (at least primarily) to do with impersonation -

    a Response.Redirect sends a "moved" message to the browser - and gives him the new location of the file, in your case the browser tries to open the file "//networkPath/folder1/subFolder1/fileName" - is this reachable from the client??

    in IIS you can map virtual directories to network locations, e.g. the vdir "/share" could point to "//networkPath/folder1/subFolder1" - so a Response.Redirect to "/share/fileName" would work.

    give that a try.



    ---
    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]

    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<9042d637c00c4ee6b30c8441d83365f0@DotNetMonster.co m>

    Hi,

    I have a question regd. Windows authentication and network file access.
    My asp.net application doesn't use any of the .NET's authentication schemes
    (Forms, Windows or Passport) yet.
    I have a login page where the users would supply their credentials and the
    business logic compares these

    credentials against SQLServer database and allows/denies access to the
    website.
    So far so good.

    But now, my application needs to access some files located on the Domain
    network.
    The first thing that came in my mind is Impersonation.

    I did change my web.config file to use Windows authentication as follows...

    <authentication mode="Windows" />

    <authorization>
    <allow users="*" />
    </authorization>

    <identity impersonate="true"
    userName="domainName\loginID"
    password="password"
    />

    This "domainName\loginID" account HAS full rights over the network resource.

    Now I have UNCHECKED Allow Anonymous Access in IIS.

    But I still cannot access the file on the network.

    It errors out at the Response.Redirect
    ("//networkPath/folder1/subFolder1/fileName");
    as Page cannot be displayed.

    I have checked the User.Identity.Name and it looks correct (domainName\
    loginID)
    Even the User.Identity.AuthenticationType is good (NTLM)

    I'm surely missing something critical.

    Any help in this regards is greatly appreciated.

    Thanks in advance,
    Srivalli.

    --
    Message posted via [url]http://www.dotnetmonster.com[/url]

    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier [DevelopMentor] 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