且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NTLM 身份验证 - 在 PHP 中获取 Windows 登录名、域和主机

更新时间:2023-11-04 11:36:34

当我尝试使用 Firefox 时,会提示我输入登录名和密码.当我发布提示时,脚本从提示中获取登录名,但这不是我想要做的:我必须让它与 IE 一起使用,而且我不想再次输入登录名和密码.我想要当前 Windows 会话的登录信息.

When I try with Firefox, I get a prompt for a login and a password. When I post the prompt, the script gets the login from the prompt, but this is not what I want to do : I have to get this to work with IE, and I don't want to type again login and password. I want the login of the current Windows session.

您可以通过更改 Firefox 设置来删除提示:

You can remove the prompt, by changing the Firefox settings:

  • 在地址栏中输入:about:config"
  • 检查 network.automatic-ntlm-auth.trusted-uris
  • 将值设置为您的域或域的一部分,例如 mycompany.com(用逗号分隔多个值)

对于 IE,您需要将页面(内联网)的安全设置设置为低于 Internet 其他部分的安全设置.请参阅 https://superuser.com/questions/148063/why-does-internet-explorer-keep-asking-me-for-ntlm-credentials-in-an-intranet-zo

For IE you need to set the security settings for your page (intranet) lower than for the rest of the internet. Please see https://superuser.com/questions/148063/why-does-internet-explorer-keep-asking-me-for-ntlm-credentials-in-an-intranet-zo