You are here

public function SimplesamlphpAuthManager::allowUserByAttribute in simpleSAMLphp Authentication 8.3

Asks all modules if current federated user is allowed to login.

Return value

bool Returns FALSE if at least one module returns FALSE.

File

src/Service/SimplesamlphpAuthManager.php, line 293

Class

SimplesamlphpAuthManager
Service to interact with the SimpleSAMLPHP authentication library.

Namespace

Drupal\simplesamlphp_auth\Service

Code

public function allowUserByAttribute() {
  $attributes = $this
    ->getAttributes();
  foreach ($this->moduleHandler
    ->getImplementations('simplesamlphp_auth_allow_login') as $module) {
    if ($this->moduleHandler
      ->invoke($module, 'simplesamlphp_auth_allow_login', [
      $attributes,
    ]) === FALSE) {
      return FALSE;
    }
  }
  return TRUE;
}