SgDotNet
Singapore Professional .NET User Group -For Cool Developers

Integrated Windows Authentication

Latest post 09-06-2006 5:26 PM by icelava. 9 replies.
  • 07-27-2006 11:52 AM

    • ci
    • Top 150 Contributor
    • Joined on 07-27-2004
    • Posts 12

    Integrated Windows Authentication

    Hi,

    I've an intranet application which use integrated windows authentication (domain account).

    The application needs to upload a file and save it to a folder in another server. However, I encountered Access Denied error while trying to save the file in the folder.

    All the necessary rights have been given to the domain account to access this remote server.

    Have tried to access the same folder from explorer and it works. Everything is working fine in development server but not UAT server

     

    Here's my settings

     

    1) Web.Config

                <identity impersonate="true" />

                    <authentication mode="Windows" />

     

    2) IIS

                Unchecked “Enable anonymous access”

                Unchecked “Digest authentication”

    Unchecked “Basic authentication”

    Unchecked “.Net passport authentication”

    Checked “Integrated Windows Authentication”

               

    3) Browser Setting

                Checked “Enable Integrated Windows Authentication” (Internet Options – Advanced)

                Choose “Automatic logon only in Intranet zone” (Internet Options – Security – Local intranet)

     

    Did I miss out anything?

     

    How do I check (in code) which account is being used to access the server?

     

     

     

    Appreciate your help. Thanks

     

  • 07-27-2006 6:27 PM In reply to

    Re: Integrated Windows Authentication

    Out of the box it is not possible to write the file onto a remote server even if the user you are using is perfectly valid on both machines. I remember that If your have 2003 Servers in a 2003 domain you can set up delegation between the two servers in AD but I don't recall the details of how exaclty this works.

    This information is some years old, so there may be other solutions now.

  • 07-27-2006 10:33 PM In reply to

    Re: Integrated Windows Authentication

    Can i assume that both servers are in the same domain?

    In order to perform delegation and access another server, you must use Kerberos rather than NTLM.

    To use Kerberos, your domain must be Native domain (not having any domain controller running NT 4.0 or older versions, in another word, in order to promote to native domain, all domain controllers must be running minimum Windows 2000 Server)

    Check it out here for more information on Kerberos Network Authentication Protocol.

    Maung Maung
  • 07-28-2006 9:36 AM In reply to

    • ci
    • Top 150 Contributor
    • Joined on 07-27-2004
    • Posts 12

    Re: Integrated Windows Authentication

    Yes, both servers are in the same domain.

     And the other server is on Windows 2000 as well. By default, Windows 2000 server use Kerberos right?

  • 07-28-2006 11:23 AM In reply to

    Re: Integrated Windows Authentication

    That depends on how is the first domain in the forest is setup, meaning the settings you choose during the DCPROMO wizard will decide if the domain is setup to operate in native mode or not.  You can still promote the existing domain to native mode by using "Active Directory Users and Computer" administration tool. (Warning: It is one-way operation, thus, cannot be revert back to mixed mode.)

    Check out Domain Model on http://www.samspublishing.com/articles/article.asp?p=130843&rl=1

    or

    Check out more on Mixed Mode vs Native Mode here. http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=7156

    Maung Maung
  • 07-28-2006 11:28 AM In reply to

    • ci
    • Top 150 Contributor
    • Joined on 07-27-2004
    • Posts 12

    Re: Integrated Windows Authentication

    Thanks for the reply.

    How do I check in code whether Kerberos or NTLM authentication is used?

  • 07-31-2006 3:42 PM In reply to

    • ci
    • Top 150 Contributor
    • Joined on 07-27-2004
    • Posts 12

    Re: Integrated Windows Authentication

    I think should be using kerberos. I will check and confirm

    Any other possible reasons for getting the access denied error?

  • 07-31-2006 7:58 PM In reply to

    Re: Integrated Windows Authentication

    I sort of found an answer for your problem.

    Put this in web.config file.

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

    ASP.NET will not authenticate the user unless anonymous access is disabled on the site.

    You can use the following code to find out which identity is being used to access the file.

    Response.Write(System.Threading.Thread.CurrentPrincipal.Identity.Name);

    Maung Maung
  • 08-01-2006 4:31 PM In reply to

    • ci
    • Top 150 Contributor
    • Joined on 07-27-2004
    • Posts 12

    Re: Integrated Windows Authentication

    I need to disable the anonymous access on this site as this is meant to be a secured system.

    Tried the System.Threading.Thread.CurrentPrincipal.Identity.Name in my code, I'm getting the correct id, i.e. user NT login id

  • 09-06-2006 5:26 PM In reply to

    Re: Integrated Windows Authentication

    ci:
    The application needs to upload a file and save it to a folder in another server.
    That is two hops. You can only authenticate and impersonate the user principal at just the web server node. This authentication process is non-transitive so the remote file server is still being access ed by the ASPNET or Network Service principal. This is by design.

    The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Page 1 of 1 (10 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems