Commit db939353 authored by Bram Driesen's avatar Bram Driesen Committed by Bram Driesen
Browse files

Issue #3297477 by Project Update Bot, BramDriesen: Automated Drupal 10 compatibility fixes

parent 68d91f39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ services:

  keycloak.request_subscriber:
    class: Drupal\keycloak\EventSubscriber\KeycloakRequestSubscriber
    arguments: ['@keycloak.keycloak', '@language_manager', '@path_processor_manager', '@path.matcher']
    arguments: ['@keycloak.keycloak', '@language_manager', '@openid_connect.state_token', '@path_processor_manager', '@path.matcher']
    tags:
      - { name: event_subscriber }

+12 −2
Original line number Diff line number Diff line
@@ -33,6 +33,13 @@ class KeycloakRequestSubscriber implements EventSubscriberInterface {
   */
  protected $languageManager;

  /**
   * The Openid Connect state token.
   *
   * @var \Drupal\openid_connect\OpenIDConnectStateToken;
   */
  protected $stateToken;

  /**
   * A path processor manager for resolving the system path.
   *
@@ -54,14 +61,17 @@ class KeycloakRequestSubscriber implements EventSubscriberInterface {
   *   The Keycloak service.
   * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
   *   The language manager service.
   * @param \Drupal\openid_connect\OpenIDConnectStateToken $state_token
   *   The Openid Connect state token.
   * @param \Drupal\Core\PathProcessor\InboundPathProcessorInterface $path_processor
   *   Inbound path processor manager.
   * @param \Drupal\Core\Path\PathMatcherInterface $path_matcher
   *   The path matcher.
   */
  public function __construct(KeycloakServiceInterface $keycloak, LanguageManagerInterface $language_manager, InboundPathProcessorInterface $path_processor, PathMatcherInterface $path_matcher) {
  public function __construct(KeycloakServiceInterface $keycloak, LanguageManagerInterface $language_manager, OpenIDConnectStateToken $state_token, InboundPathProcessorInterface $path_processor, PathMatcherInterface $path_matcher) {
    $this->keycloak = $keycloak;
    $this->languageManager = $language_manager;
    $this->stateToken = $state_token;
    $this->pathProcessor = $path_processor;
    $this->pathMatcher = $path_matcher;
  }
@@ -106,7 +116,7 @@ class KeycloakRequestSubscriber implements EventSubscriberInterface {

    // Construct the Keycloak end session endpoint parameters.
    $query = [
      'state' => OpenIDConnectStateToken::create(),
      'state' => $this->stateToken->create(),
    ] + $request_query;

    // Whether to add language parameter. This is only needed,