Obtaining user identification from the browser

I used to work in a bank that had a very interesting function on the intranet. After entering the system, global variables were set to PHP on your computer through Apache, and they contained the identity of the user who was registered on the computer. Now I am at a new job and I wonder how it works! I would like to once again realize this thing.

What am I doing here:

  • FreeBSD server, version unknown to me.
  • Apache 2.2 Web Server
  • PHP 5, some custom compilation, which for various reasons I can not update or change.
  • Ms ad
  • All users connecting to their computers use the active directory, all of them are in the same domain.

I had something like this:

echo $_SERVER['username'] 

which will print the username of the user who is currently registered.

Can someone explain how this can be done?

PS If any of my server settings is not what is required, say so, because then I will have a reason to ask the bosses to give me one of my own, with more control.

+4
source share
2 answers

There can be many ways. However, many of them depend on control over the client, as well as on the server.

Obvious data sources include:

However, none of this explains how the value appeared in the session — it must have been implemented in PHP code.

Therefore, not knowing how this was implemented on your previous site, we cannot tell you:

  • Was it safe and correctly implemented.
  • behavior replication method

Given your list of resources, while it would be possible to implement authentication based on direct LDAP calls by passing the username and password through your application, I highly recommend using (e.g. openId), but restricting providers only to your openid provider - which will use MSAD as a backend.

+2
source

I did not understand the question correctly, so I am editing my post ...

you can use apache auth, you can do auth using ip or hostnames

http://httpd.apache.org/docs/2.0/en/howto/auth.html

-3
source

All Articles