I'm authenticating ldap users through Apache2's authnz_ldap module successfully. It is not clear to me how to fetch their username once they have logged in so that I can interact with them through any following forms/webpages. I've tried the typical ways (os.getenv os.environ getpass etc.) but they either just give me www-data or None result.
I suspect what I need is available in either an apache/ldap module, but I could use some help to search down the correct path. Can anyone point me in the right direction?
To answer my own question: http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html#exposed
Although the environment key was not documented, i threw in a few likely suspects and found that os.getenv('AUTHENTICATE_UID') was the winner.
I hope this saves someone some time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With