On different servers, I have applications in PHP and Java (other languages too). I am developing all new applications to use LDAP authentication so I don't have to do any user management, but more importantly, my users would have the same login credentials on all apps on all servers. There is an OpenLDAP server where users are defined.
For Java apps running in Tomcat, JBoss or WebSphere servers, I configured LDAP authentication and use the j_security_check action to authenticate. Users are restricted to different URL's based upon their role membership.
In Java, LDAP groups are mapped to roles. The HttpServletRequest class exposes an isUserInRole() method which I use within servlets to restrict which page sections and actions. As an example, the URL security won't let a user not in "finance" role from accessing those pages, and when displaying the menu, I suppress the items from being shown by checking the membership with HttpServletRequest.isUserInRole("finance") so a non-finance member doesn't see them.
In httpd/Apache 4.4 running on Oracle Linux 9.6, I've configured ldap and authnz modules to show a login form. It successfully authenticates with my LDAP server. I can configure the directives in httpd conf files so that people in selected ldap-group may access selected directories.
My question is, is there a isUserInRole method available in PHP to check group membership which is made available by mod_ldap so that I can show/hide items within my pages? Or do I need to connect to LDAP using PHP methods as given in https://www.php.net/manual/en/book.ldap.php ? In Java, the servlets do not need any separate code for LDAP connecting, searching or fetching.