How do I retrieve the user information of a user authenticated with Apache's mod_ldap?

前端 未结 2 761
我寻月下人不归
我寻月下人不归 2021-01-15 04:20

I have LDAP authentication working with Apache. Now I need to know how I can get what user logged in with PHP. Is it even possible? Do I have to do the authentication in PHP

2条回答
  •  花落未央
    2021-01-15 05:03

    I am not sure if it's the same with mod_lsap, but when you authenticate using Apache, the username and password are stored in the $_SERVER's superglobals.

    $_SERVER['PHP_AUTH_USER']
    $_SERVER['PHP_AUTH_PW']
    

    http://ca.php.net/manual/en/reserved.variables.server.php

提交回复
热议问题