You are here

OpenidConnectServiceProvider.php in OpenID Connect / OAuth client 2.x

File

src/OpenidConnectServiceProvider.php
View source
<?php

namespace Drupal\openid_connect;

use Drupal\Core\DependencyInjection\ContainerBuilder;
use Drupal\Core\DependencyInjection\ServiceProviderBase;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;

/**
 * Service provider for the openid_connect module.
 */
class OpenidConnectServiceProvider extends ServiceProviderBase {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {

    // This service was introduced as a new dependency in version 2.0alpha3.
    try {
      $container
        ->getDefinition('externalauth.authmap');
    } catch (ServiceNotFoundException $exception) {

      // Requires 'externalauth.authmap'.
      $container
        ->removeDefinition('openid_connect.openid_connect');
    }
  }

}

Classes

Namesort descending Description
OpenidConnectServiceProvider Service provider for the openid_connect module.