简体   繁体   中英

Asp.Net windows authentication: is it possible not to ask login if user is already logged in active directory?

i'm developing an asp.net application. The app will be used mainly in intranet environment, from intranet users. I've enabled Windows auhtentication and my app works:

  1. In developing environment, it logged me automatically without asking username

  2. In a Windows Server production environment, with Windows authentication, it ask username and password (of active directory) then log correctly user

My question is: - Is it possible to automatically recognize windows user already logged in Windows, without asking username and password ?

You can set your application to use Windows authentication in web.config . Have you tried this?

<system.web> ... <authentication mode="Windows"/> ... </system.web>

More info can be found here: How To: Use Windows Authentication in ASP.NET

<-- Edit --->

You will also need to configure your website in IIS to use Windows Authentication. In IIS, go to your website, double click on Authentication, disable Anonymous Authentication, Enable Windows Authentication. In Windows Authentication, open Providers...(right hand side), ensure that NTLM is visible and moved to the top of the list. Restart your app pool and now you should be able to automatically get users logged in on the server as well.

Depending on what your domain is setup like you might need to add the domain name entires for the internal site to the intranet zone.

So if you have http://oursite.company.domain/ you might need to add it to the intranet sites

http://blog.thesysadmins.co.uk/group-policy-internet-explorer-security-zones.html

Note the numbering of the Security Zones. 1 for Intranet Zone, 2 for Trusted Sites, 3 for Internet Zone and 4 for Restricted Sites Zone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM