如何使用Microsoft AD为内部PHP应用程序实现单点登录(SSO)?

rec*_*bot 28 php apache2 nginx active-directory single-sign-on

我隐约意识到,在加入域的计算机上,可以要求IE发送一些额外的标题,我可以用它来自动登录到应用程序.我用mod_php在windows服务器上运行apache.我希望能够避免用户必要时登录.我发现了一些关于Kerberos和Apache模块的链接.

http://www.onlamp.com/pub/a/onlamp/2003/09/11/kerberos.html?page=last https://metacpan.org/pod/Apache2::AuthenNTLM

由于我在Windows上运行,因此证明安装Perl或Apache模块并非易事.但PHP不能访问HTTP标头吗?

我发现了这个但它没有进行任何身份验证,只是表明PHP可以读取NTLM头文件. http://siphon9.net/loune/2007/10/simple-lightweight-ntlm-in-php/

我希望能够让我的用户只指向该应用程序并让它们自动进行身份验证.有没有人有这方面的经验或者让它一起工作?

更新 自从最初发布此问题以来,我们已将设置更改为仍在Windows上运行的nginx和php-fcgi.Windows上的Apache2和php-cgi可能是您在Windows上配置的最慢设置之一.它看起来可能仍然需要Apache(它适用于php-fcgi)但我更喜欢nginx解决方案.

我还是不明白(并希望接受教育)为什么HTTP服务器插件是必要的,我们不能拥有PHP,Web服务器无关的解决方案.

rea*_*idt 18

您只需要mod_auth_sspiApache模块.

示例配置:

AuthType SSPI
SSPIAuth On
SSPIAuthoritative On
SSPIDomain mydomain

# Set this if you want to allow access with clients that do not support NTLM, or via proxy from outside. Don't forget to require SSL in this case!
SSPIOfferBasic On

# Set this if you have only one domain and don't want the MYDOMAIN\ prefix on each user name
SSPIOmitDomain On

# AD user names are case-insensitive, so use this for normalization if your application's user names are case-sensitive
SSPIUsernameCase Lower
AuthName "Some text to prompt for domain credentials"
Require valid-user
Run Code Online (Sandbox Code Playgroud)

不要忘记,您还可以在Windows域中使用Firefox进行透明SSO:只需转到about:config,搜索network.automatic-ntlm-auth.trusted-uris并输入内部应用程序的主机名或FQDN(如myserver或myserver.corp.domain.com).您可以有多个条目,它是以逗号分隔的列表.

  • 这行得通,您得到了赏金,而我被阿帕奇困住了。其他一些也可能工作,但仍然不需要Apache或IIS。我希望有一天能重温这个问题。 (2认同)