Skip to content
Snippets Groups Projects
Commit 1fb49d49 authored by Sigmund Augdal's avatar Sigmund Augdal
Browse files

Added support for openid connect front channel logout

parent 0d159043
No related branches found
No related tags found
No related merge requests found
......@@ -111,6 +111,10 @@ class OpenIDConnect extends \SimpleSAML\Module\authoauth2\Auth\Source\OAuth2
public function logout(&$state)
{
$providerLabel = $this->getLabel();
if (array_key_exists('oidc:localLogout', $state) && $state['oidc:localLogout'] === true) {
Logger::debug("authoauth2: $providerLabel OP initiated logout");
return;
}
$endSessionEndpoint = $this->config->getString('urlEndSession', null);
if (!$endSessionEndpoint) {
Logger::debug("authoauth2: $providerLabel No urlEndSession configured, not doing anything for logout");
......
......@@ -70,4 +70,21 @@ class OIDCLogoutHandler
\SimpleSAML\Auth\Source::completeLogout($state);
// @codeCoverageIgnoreStart
}
public function handleRequest()
{
$this->handleRequestFromRequest($_REQUEST);
}
public function handleRequestFromRequest(array $request)
{
Logger::debug('authoauth2: logout request=' . var_export($request, true));
$config = \SimpleSAML\Configuration::getInstance();
$sourceId = $request['authSource'];
$as = new \SimpleSAML\Auth\Simple($sourceId);
$as->logout([
'oidc:localLogout' => true,
'ReturnTo' => $config->getBasePath().'logout.php',
]);
}
}
<?php
$handler = new \SimpleSAML\Module\authoauth2\OIDCLogoutHandler();
$handler->handleRequest();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment