I believe what you want is called Single Sign-On (SSO), that is, the ability of the user to perform authentication once and, from there, all systems share the information of login.
On the web, sharing authentication is common through the open Openid standard. This is the case of "Login with Google" or "Login with Facebook" or "Login with Twitter" that many websites offer.
On intranets, it is very common for systems to perform SSO using the protocol LDAP on a job Active Directory (Windows).
However, SSO does not always provide a transparent login to the user, that is, many implementations require the user to write their credentials to each authentication.
I did a search for "php sso active directory Transparent login" and came up this post from the OS, through which I came to this page about an Apache extension called mod_auth_kerb.
I am not an expert on networks or Windows Server, but I warn you that implementing all the necessary infrastructure can be a very laborious and complicated process.
Sure, you can do some other scam that just takes the username from somewhere, but then security goes down.
In a quick search, apparently not with PHP, but yes javascript
– brasofilo
I found nothing concrete.
– João Neto
I believe it is a vulnerability to let a script discover the user’s username... You will have to go another way... Kicking maybe a browser applet or Extension...
– Wakim
I found this other stack in the English OS with a snippet that uses an Activex object, but I don’t know if the result is what it should be. In addition to running only on the Ieca, here showed only Function Activexobject() { [Native code] }
– Bruno Augusto
Yeah, I found the one that uses Activex, and really only runs on IE :/
– João Neto
Is your intranet in a domain? If yes it is possible through webserver (Apache or IIS)
– gmsantos
@gmsantos It’s in a domain yes. How do I do it then?
– João Neto
Apache or IIS??
– gmsantos
@gmsantos Apache.
– João Neto