You are here

protected function SimplesamlphpAuthManager::getSimpleSamlConfiguration in simpleSAMLphp Authentication 8.3

Returns a SimpleSAML configuration instance.

Return value

\SimpleSAML\Configuration|null The SimpleSAML Configuration instance.

1 call to SimplesamlphpAuthManager::getSimpleSamlConfiguration()
SimplesamlphpAuthManager::getStorage in src/Service/SimplesamlphpAuthManager.php
Get SimpleSAMLphp storage type.

File

src/Service/SimplesamlphpAuthManager.php, line 169

Class

SimplesamlphpAuthManager
Service to interact with the SimpleSAMLPHP authentication library.

Namespace

Drupal\simplesamlphp_auth\Service

Code

protected function getSimpleSamlConfiguration() {
  if (!empty($this->simplesamlConfig)) {
    return $this->simplesamlConfig;
  }
  else {
    $this
      ->checkLibrary();
    try {
      $this->simplesamlConfig = Configuration::getInstance();
      return $this->simplesamlConfig;
    } catch (CriticalConfigurationError $e) {
      if ($this->currentUser
        ->hasPermission('administer simplesamlphp authentication') && $this->currentUser
        ->isAdminRoute()) {
        $this->messenger
          ->addError($this
          ->t('There is a Simplesamlphp configuration problem. @message', [
          '@message' => $e
            ->getMessage(),
        ]), 'error');
      }
      return NULL;
    }
  }
}