Merge pull request #525 from nextcloud/slo-web-server-decode

Allow setting of "retrieveParametersFromServer"
This commit is contained in:
blizzz 2021-05-05 13:36:27 +02:00 committed by GitHub
commit 7e232620c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

View File

@ -418,8 +418,14 @@ class SAMLController extends Controller {
$stay = true ; // $auth will return the redirect URL but won't perform the redirect himself
if ($isFromIDP) {
$keepLocalSession = true ; // do not let processSLO to delete the entire session. Let userSession->logout do the job
$targetUrl = $auth->processSLO($keepLocalSession, null, false, null, $stay);
$targetUrl = $auth->processSLO(
$keepLocalSession,
null,
$this->SAMLSettings->usesSloWebServerDecode(),
null,
$stay
);
$errors = $auth->getErrors();
if (!empty($errors)) {
foreach($errors as $error) {

View File

@ -88,6 +88,10 @@ class SAMLSettings {
return ($setting === '1' && $type === 'saml');
}
public function usesSloWebServerDecode() : bool {
return $this->config->getAppValue('user_saml', 'security-sloWebServerDecode', '0') === '1';
}
/**
* get config for given IDP
*

View File

@ -90,7 +90,8 @@ class Admin implements ISettings {
'signatureAlgorithm' => [
'type' => 'line',
'text' => $this->l10n->t('Algorithm that the toolkit will use on signing process.')
]
],
'sloWebServerDecode' => $this->l10n->t('Retrieve query parameters from $_SERVER. Some SAML servers require this on SLO requests.'),
];
$generalSettings = [
'uid_mapping' => [

View File

@ -83,7 +83,8 @@ class AdminTest extends \Test\TestCase {
'signatureAlgorithm' => [
'type' => 'line',
'text' => 'Algorithm that the toolkit will use on signing process.'
]
],
'sloWebServerDecode' => 'Retrieve query parameters from $_SERVER. Some SAML servers require this on SLO requests.',
];
$generalSettings = [
'idp0_display_name' => [