使用Active Directory凭据自动登录而不输入登录详细信息 [英] Auto login by using active directory credential without entering login detail

查看:119
本文介绍了使用Active Directory凭据自动登录而不输入登录详细信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Active Directory凭据对用户进行身份验证,无需输入用户名和密码。只需在浏览器中键入url,它就会通过Active目录的Windows凭证进行身份验证。



我尝试了什么:



I want to authenticate users using Active directory credential and no need to enter user name and password. simply type url in browser and it will authenticate by windows credential of Active directory.

What I have tried:

public string GetCurrentUserWindowsLogin()
		{

			string windowsLogin = Page.User.Identity.Name;
			//Normally if the domain is present you get a string like DOMAINNAME\username, remove the domain
			int hasDomain = windowsLogin.IndexOf(@"\");
			if (hasDomain > 0)
			{
				windowsLogin = windowsLogin.Remove(0, hasDomain + 1);
			} //end if 
			return windowsLogin;
		} //end GetCurrentUserWindowsLogin

推荐答案

如果您的用户与您的服务器位于同一个域中,您可以使其工作。

  • 对于Internet Explorer,用户需要将您的站点添加到本地Intranet区域,因为它只将其Windows凭据发送到该区域中的站点;
  • 对于Chrome,用户还需要将您的网站添加到IE的本地Intranet区域。所有最新版本的Chrome都将使用IE区域来控制自动Windows身份验证。
  • 对于Firefox,用户需要打开 about:config ,并将您的网站添加到< kbd> network.automatic-ntlm-auth.trusted-uris 设置。



    可以指定多个站点,用逗号分隔。



    他们可能还需要将您的网站添加到 network.negotiate-auth.delegation-uris network.negotiate-auth.trusted- uris 设置,取决于他们的设置。



    或者,他们可以安装 Firefox的集成身份验证 [ ^ ]附加组件,通过友好的GUI管理列表。
If your users are in the same domain as your server, you can make this work.
  • For Internet Explorer, the user needs to add your site to the "Local Intranet" zone, as it only sends their Windows credentials to sites in that zone;
  • For Chrome, the user also needs to add your site to IE's "Local Intranet" zone. All recent versions of Chrome will use the IE zones to control automatic Windows authentication.
  • For Firefox, the user will need to open about:config, and add your site to the network.automatic-ntlm-auth.trusted-uris setting.

    Multiple sites can be specified, separated with a comma.

    They may also need to add your site to the network.negotiate-auth.delegation-uris and network.negotiate-auth.trusted-uris settings, depending on their setup.

    Alternatively, they could install the Integrated Authentication for Firefox[^] add-on to manage the list via a friendlier GUI.


这篇关于使用Active Directory凭据自动登录而不输入登录详细信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆