WindowsAadSSORouteSubscriber.php in OpenID Connect Microsoft Azure Active Directory client 2.0.x
File
src/Routing/WindowsAadSSORouteSubscriber.php
View source
<?php
namespace Drupal\openid_connect_windows_aad\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
use Drupal\Core\Utility\Error;
class WindowsAadSSORouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('user.logout')) {
try {
$configuration = \Drupal::config('openid_connect.settings.windows_aad');
$settings = $configuration
->get('settings');
$enabled = $configuration
->get('enabled');
} catch (Exception $exception) {
$configuration = FALSE;
$variables = Error::decodeException($exception);
\Drupal::logger('openid_connect_windows_aad')
->error('Failed to check OpenID Connect Windows AAD configuration so Single Sign Off will remain disabled. %type: @message in %function (line %line of %file).', $variables);
}
if ($configuration && $enabled && isset($settings['enable_single_sign_out']) && $settings['enable_single_sign_out']) {
$route
->setDefault('_controller', '\\Drupal\\openid_connect_windows_aad\\Controller\\WindowsAadSSOController::logout');
}
}
}
}