drupalauth / simplesamlphp-module-drupalauth

simpleSAMLphp module that turns Drupal site into IdP(Identity Provider)
Other
24 stars 38 forks source link

Database connection is not defined if default site is not IDP #58

Closed cato-cit closed 4 years ago

cato-cit commented 4 years ago

When you login IDP, it will try to get the DB connection info from IDP site. If your IDP is not the Drupal default site (like subsite1 is IDP and subsite2 is the SP), it's still trying to get the settings(db connection info) from default site. That cause the below error if default settings db connection is empty.

The website encountered an unexpected error. Please try again later. Drupal\Core\Database\ConnectionNotDefinedException: The specified database connection is not defined: default in Drupal\Core\Database\Database::openConnection() (line 361 of /var/www/tdk/docroot/core/lib/Drupal/Core/Database/Database.php). Drupal\Core\Database\Database::openConnection('default', 'default') (Line: 166) Drupal\Core\Database\Database::getConnection('default') call_user_func_array('Drupal\Core\Database\Database::getConnection', Array) (Line: 79) Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'database') (Line: 173) Drupal\Component\DependencyInjection\Container->get('database', 1) (Line: 265) Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters(Array) (Line: 62) Drupal\Component\DependencyInjection\PhpArrayContainer->createService(Array, 'cache.container') (Line: 173) Drupal\Component\DependencyInjection\Container->get('cache.container') (Line: 544) Drupal\Core\DrupalKernel->getCachedContainerDefinition() (Line: 896) Drupal\Core\DrupalKernel->initializeContainer() (Line: 477) Drupal\Core\DrupalKernel->boot() (Line: 33) SimpleSAML\Module\drupalauth\DrupalHelper->bootDrupal('/var/www/tdk/docroot') (Line: 132) SimpleSAML\Module\drupalauth\Auth\Source\External->getUser() (Line: 299) SimpleSAML\Module\drupalauth\Auth\Source\External::resume() (Line: 12) require('/var/www/tdk/vendor/simplesamlphp/simplesamlphp/modules/drupalauth/www/resume.php') (Line: 254) SimpleSAML\Module::process() (Line: 10)

cato-cit commented 4 years ago

Fixed in #59