Enable Windows Authentication and disable Anonymous authentication in IIS.
If windows authentication option is not there then you have to enable it by following steps:
Once it is enables Browsers will start prompting for ldap/windows credentials.
Which is fine for internet. But If you want to set up intranet site and do not want user to be prompted for credentials, You have to do some browser settings as follows:
For Internet explorer :
Settings > Internet Options > Security
Add your site to local interanet, IE will stop asking for credentials.
For FF You can do setting in about:config url and add sites in NTLM "network.automatic-ntlm-auth.trusted-uris".
If that seems tuff You can install a small plugin from "https://addons.mozilla.org/en-US/firefox/addon/integrated-auth-for-firefox/" and add your site url there.
Window / ldap username can be retrieved from server variables as follows in asp:
Request.ServerVariables("LOGON_USER")
Request.ServerVariables("auth_user")
Request.ServerVariables("REMOTE_USER")
happy coding :)
Thank You For Sharing this Post . It will be Helpful in Future in the field of Tech @ Support
ReplyDeleteD - Link Costumer Service