Allow email to be retrieve by SSO ReverseProxy

If REMOTE_EMAIL header is set, use it as user email.
If REVERSE_PROXY_DEFAULT_DOMAIN is set but not REMOTE_EMAIL, use the current construct.
This commit is contained in:
mildis
2020-08-29 07:59:59 +02:00
committed by GitHub
parent 4dd586cdce
commit 33c3b32cda
6 changed files with 42 additions and 3 deletions

View File

@@ -140,6 +140,15 @@ class RequestTest extends Base
$this->assertEquals('test', $request->getRemoteUser());
}
public function testGetRemoteEmail()
{
$request = new Request($this->container, array(), array(), array(), array(), array());
$this->assertEmpty($request->getRemoteEmail());
$request = new Request($this->container, array(REVERSE_PROXY_EMAIL_HEADER => 'test@example.com'), array(), array(), array(), array());
$this->assertEquals('test@example.com', $request->getRemoteEmail());
}
public function testGetQueryString()
{
$request = new Request($this->container, array(), array(), array(), array(), array());