class WindowsAadSSORouteSubscriber in OpenID Connect Microsoft Azure Active Directory client 8
Same name and namespace in other branches
- 2.0.x src/Routing/WindowsAadSSORouteSubscriber.php \Drupal\openid_connect_windows_aad\Routing\WindowsAadSSORouteSubscriber
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\openid_connect_windows_aad\Routing\WindowsAadSSORouteSubscriber
Expanded class hierarchy of WindowsAadSSORouteSubscriber
1 string reference to 'WindowsAadSSORouteSubscriber'
1 service uses WindowsAadSSORouteSubscriber
File
- src/
Routing/ WindowsAadSSORouteSubscriber.php, line 12
Namespace
Drupal\openid_connect_windows_aad\RoutingView source
class WindowsAadSSORouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
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) {
// Not important to differentiate between Exceptions here, we just need
// make it know that something is wrong and we won't enable SSOut.
$configuration = FALSE;
// TODO: When watchdog_exception() is deprecated and ExceptionLogger is
// available, update this to use ExceptionLogger.
// @see https://www.drupal.org/project/drupal/issues/2932518
$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);
}
// Override the controller for the user.logout route in order to redirect
// to the Windows Azure AD Single Sign out endpoint if SSOut is enabled.
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');
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |
WindowsAadSSORouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |