Release 2.26 (#5189)
* bring back deprecated methods * bump packages * fix SAML redirect * config flag for break times * use class constant instead of string in attributes * throw if all tags were not found - fixes #4792
This commit is contained in:
@@ -50,6 +50,10 @@ class SamlAuthenticator extends AbstractAuthenticator
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$request->isMethod(Request::METHOD_POST)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$this->httpUtils->checkRequestPath($request, $this->options['check_path'])) {
|
||||
return false;
|
||||
}
|
||||
@@ -81,7 +85,7 @@ class SamlAuthenticator extends AbstractAuthenticator
|
||||
|
||||
// file_put_contents(__DIR__ . '/../../var/log/saml.xml', $oneLoginAuth->getLastResponseXML());
|
||||
|
||||
if ($oneLoginAuth->getErrors()) {
|
||||
if (\count($oneLoginAuth->getErrors()) > 0) {
|
||||
throw new AuthenticationException($oneLoginAuth->getLastErrorReason());
|
||||
}
|
||||
|
||||
|
||||
@@ -24,15 +24,12 @@ final class SamlAuthenticationSuccessHandler extends DefaultAuthenticationSucces
|
||||
|
||||
protected function determineTargetUrl(Request $request): string
|
||||
{
|
||||
if ($this->options['always_use_default_target_path']) {
|
||||
return $this->options['default_target_path'];
|
||||
}
|
||||
|
||||
$relayState = $request->get('RelayState');
|
||||
$loginUrl = $this->httpUtils->generateUri($request, $this->options['login_path']);
|
||||
|
||||
if ($relayState !== null && $relayState !== '' && $relayState !== $loginUrl) {
|
||||
return $relayState;
|
||||
if (\is_scalar($relayState)) {
|
||||
$relayState = (string) $relayState;
|
||||
if ($relayState !== $this->httpUtils->generateUri($request, (string) $this->options['login_path'])) {
|
||||
return $relayState;
|
||||
}
|
||||
}
|
||||
|
||||
return parent::determineTargetUrl($request);
|
||||
|
||||
Reference in New Issue
Block a user