Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable-3.3] slo web server decode (Backport #525) #526

Merged
merged 3 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,13 @@ public function singleLogoutService() {
$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
);
} else {
// If request is not from IDP, we must send him the logout request
$parameters = array();
Expand Down
4 changes: 4 additions & 0 deletions lib/SAMLSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ public function allowMultipleUserBackEnds() {
return ($setting === '1' && $type === 'saml');
}

public function usesSloWebServerDecode() : bool {
return $this->config->getAppValue('user_saml', 'security-sloWebServerDecode', '0') === '1';
}

/**
* get config for given IDP
*
Expand Down
3 changes: 2 additions & 1 deletion lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ public function getForm() {
'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' => [
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Settings/AdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ public function formDataProvider() {
'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' => [
Expand Down