简体   繁体   English

通过PHP验证OSX Server用户

[英]Authenticate OSX Server Users via PHP

I am running OSX Server on a MacMini in our office. 我在我们办公室的MacMini上运行OSX Server
The Users (created with the OSX Server App) are used for authenticating the SMB and VPN service. 用户(使用OSX Server App创建)用于验证SMBVPN服务。

Now i would like the users to login in our intranet-app via PHP. 现在,我希望用户通过PHP登录我们的intranet-app。

Are there any possibilities to access the OSX Server Users? 是否可以访问OSX Server用户? Does it work in other languages? 它可以使用其他语言吗?

If the web server is running on the same Mac Mini (or another Mac server that is attached to the same OD server), you can use browser authentication to control access and then use the REMOTE_USER environment variable from php to determine which user is logged in. 如果Web服务器在同一台Mac Mini(或连接到同一台OD服务器的另一台Mac服务器)上运行,则可以使用浏览器身份验证来控制访问,然后使用php中的REMOTE_USER环境变量来确定登录的用户。 。

To set this up, you're going to need to enable login on the Websites control panel in the Server App and then specify which users are allowed to access the site ('Who can access' in the web site information panel). 要进行此设置,您将需要在Server App中的“网站”控制面板上启用登录,然后指定允许哪些用户访问该网站(网站信息面板中的“谁可以访问”)。

For security purposes, make sure you use SSL so that your password exchanges are protected from prying eyes, although by default I'm pretty user you at least get Digest authentication instead of Basic, which is a little better. 为了安全起见,请确保使用SSL,以保护您的密码交换免遭窥视,但默认情况下,我很漂亮的用户是您至少获得了Digest身份验证,而不是Basic身份,这更好一些。

If you prefer not to use the web server security, you're going to have to jump through some hoops to authenticate, most likely involving using LDAP to talk to the Open Directory server on the Mini. 如果您不想使用Web服务器的安全性,则必须跳过一些步骤来进行身份验证,最有可能涉及使用LDAP与Mini上的Open Directory服务器进行通信。 In the old days, you used to be able to use LDAP authorizations to validate passwords against the OD server, but I'm not sure if that still works. 在过去,您曾经能够使用LDAP授权来验证针对OD服务器的密码,但是我不确定这是否仍然有效。 Either way, it's a lot of work. 无论哪种方式,这都是很多工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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