Hi I'd like use Window NT authentification on domain in ASP.Internet 2. site.

I'd like pressure user input qualifications when he first visit my site. Site is going to be used only on intranet.

I understand domain is within format x.y.com.

I increase web.confing element:

<authentication mode="Home windows"/>

My first issue is:

  1. However I don’t how show clasic window formular for input user qualifications when user visit an internet site.

I am talking about this type:


2 And my second issue is authentification on domain. I google it and just this part code work with me.

public class WinAPI


    [DllImport("advapi32.dll", SetLastError = true)]

    public static extern bool LogonUser(string lpszUsername, string lpszDomain,

        string lpszPassword, int dwLogonType, int dwLogonProvider, out int phToken)

    //API to shut the credential token

    [DllImport("kernel32", EntryPoint = "CloseHandle")]

    public static extern lengthy CloseHandle(lengthy hObject)

   int hToken = 2

        bool ret = WinAPI.LogonUser("userName", "domain.example.com", "password", WinAPI.LOGON32_LOGON_NETWORK,


        out hToken)

        if (ret == true)

        Home windows domain User ")




        Home windows domain User ")


The primary reason for Home windows authentication is, for intranets, that the login box does not appear, customers authenticate instantly utilizing their domain qualifications. Why on the planet would you need to pressure customers to key in their user title and password, most likely in obvious text unless of course you are likely to install an SSL certificate, after which make an effort to impersonate them by hand?

The only method to do what you would like would be to switch on Fundamental Authentication in IIS (Instructions for IIS7/IIS6). However should you choose which means you need an SSL certificate to safeguard the passwords on the road. I highly recommend you don't follow this path.

I'd increase @blowdart's answer you could also employ forms authentication together with the LdapMembershipProvider to authenticate against Active Directory.

Try reading through this link, it will let you know how you can deny use of anonymous customers, so you need to get a popup.

http://sites.asp.internet/scottgu/archive/2006/07/12/Recipe_3A00_-Enabling-Home windows-Authentication-within-an-Intranet-ASP.Internet-Web-application.aspx



        <authentication mode="Home windows" />


             <deny customers="?"/>




Observe that the <deny customers=”?”/> directive inside the <authorization> section above is exactly what informs ASP.Internet to deny use of the applying to any or all “anonymous” customers towards the site (the “?” character means anonymous user).  This forces Home windows to authenticate the consumer, and guarantees the username is definitely offered by code around the server.