Skip to content
Snippets Groups Projects
Verified Commit b221995a authored by Damien's avatar Damien
Browse files

FIX #14594 TIME 2:00 azure saml logout

parent 6293327f
No related branches found
No related tags found
No related merge requests found
......@@ -188,7 +188,7 @@ class AuthenticationController
if (!in_array($args['currentRoute'], ['/passwordRules', '/users/{id}/password'])) {
$loggingMethod = CoreConfigModel::getLoggingMethod();
if (!in_array($loggingMethod['id'], ['sso', 'cas', 'ldap', 'keycloak', 'shibboleth'])) {
if (in_array($loggingMethod['id'], ['standard'])) {
$passwordRules = PasswordModel::getEnabledRules();
if (!empty($passwordRules['renewal'])) {
$currentDate = new \DateTime();
......@@ -380,6 +380,9 @@ class AuthenticationController
} elseif ($loggingMethod['id'] == 'keycloak') {
$disconnection = AuthenticationController::keycloakDisconnection();
$logoutUrl = $disconnection['logoutUrl'];
} elseif ($loggingMethod['id'] == 'azure_saml') {
$disconnection = AuthenticationController::azureSamlDisconnection();
$logoutUrl = $disconnection['logoutUrl'];
}
return $response->withJson(['logoutUrl' => $logoutUrl]);
......@@ -667,6 +670,20 @@ class AuthenticationController
return ['login' => $login];
}
private static function azureSamlDisconnection()
{
$libDir = CoreConfigModel::getLibrariesDirectory();
if (!is_file($libDir . 'simplesamlphp/lib/_autoload.php')) {
return ['errors' => 'Library simplesamlphp not present'];
}
require_once($libDir . 'simplesamlphp/lib/_autoload.php');
$as = new \SimpleSAML\Auth\Simple('default-sp');
$url = $as->getLogoutURL();
return ['logoutUrl' => $url];
}
public function getRefreshedToken(Request $request, Response $response)
{
$queryParams = $request->getQueryParams();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment