2

I'm new to php and Apache.
I'm currently making intrantet for the hospital and I would really love to get SSO working.
I'm using Bitnami Joomla Stack VM which runs on 64-bit Ubuntu 14.04. I've followed Tim Plummer guide how to get SSO working with shmanic.com tools.
I've got this far that I can log into intranet with AD username and password but in order to get SSO working I need REMOTE_USER variable from php.

I looked for REMOTE_USER variable in Ubuntu terminal by using command php info.php where I had written in .php file phpinfo();
I also found that there's MIT Kerberos, WinBind and NTLM but I'm not sure if those are what I need.

How do I get this variable and am I looking at the right place for the REMOTE_USER or it must be displayed somewhere else?

Tim Plummer guide for Joomla SSO: [http://timplummer.com.au/4-how-to-integrate-joomla-3-with-active-directory-using-ldap.html#!kmt-start=45]
Shmanic SSO tools for Joomla: [http://shmanic.com/tools/jmapmyldap/download.htm]

Einar
  • 21
  • 2
  • 1
    I tried to follow breq solution http://stackoverflow.com/questions/20994329/apache-how-to-get-remote-user-variable but that module is in Windows binary. Ended up with _invalid ELF header_ msg. – Einar Aug 10 '16 at 05:43
  • 1
    Microsoft doesn't recommend to use NTLM. https://msdn.microsoft.com/en-us/library/cc236715.aspx – Einar Aug 10 '16 at 05:50

1 Answers1

1

In PHP you should be able to get the REMOTE_USER - variable with the following:

$remote_user = $_SERVER['REMOTE_USER']; echo $remote_user;

jonasfh
  • 4,151
  • 2
  • 21
  • 37
  • 1
    I get msg like that _PHP Notice: Undefined index: REMOTE_USER in /home/bitnami/i.php on line 2_. When I use `$r = array_key_exists( 'REMOTE_HOST', $_SERVER) ? $_SERVER['REMOTE_HOST'] : gethostbyaddr($_SERVER["REMOTE_ADDR"]);` I get msg _PHP Notice: Undefined index: REMOTE_ADDR in /home/bitnami/i.php on line 2 PHP Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/bitnami/i.php on line 2_ – Einar Aug 10 '16 at 05:38