added support for saml login (#1408)
This commit is contained in:
30
src/Saml/Security/SamlAuthenticationSuccessHandler.php
Normal file
30
src/Saml/Security/SamlAuthenticationSuccessHandler.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Saml\Security;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler;
|
||||
|
||||
final class SamlAuthenticationSuccessHandler extends DefaultAuthenticationSuccessHandler
|
||||
{
|
||||
protected function determineTargetUrl(Request $request)
|
||||
{
|
||||
if ($this->options['always_use_default_target_path']) {
|
||||
return $this->options['default_target_path'];
|
||||
}
|
||||
|
||||
$relayState = $request->get('RelayState');
|
||||
if (null !== $relayState && $relayState !== $this->httpUtils->generateUri($request, $this->options['login_path'])) {
|
||||
return $relayState;
|
||||
}
|
||||
|
||||
return parent::determineTargetUrl($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user