SimplesamlphpAuthTestManager.php in simpleSAMLphp Authentication 8.3
File
tests/simplesamlphp_auth_test/src/SimplesamlphpAuthTestManager.php
View source
<?php
namespace Drupal\simplesamlphp_auth_test;
use Drupal\simplesamlphp_auth\Service\SimplesamlphpAuthManager;
class SimplesamlphpAuthTestManager extends SimplesamlphpAuthManager {
protected $authenticated = FALSE;
public function externalAuthenticate() {
$this->authenticated = TRUE;
}
public function getStorage() {
return 'sql';
}
public function isAuthenticated() {
return $this->authenticated;
}
public function getAttributes() {
return [
'uid' => [
0 => 'saml_user',
],
'displayName' => [
0 => 'Test Saml User',
],
'mail' => [
0 => 'saml@example.com',
],
'roles' => [
0 => [
'employee',
'test_role',
],
],
];
}
public function logout($redirect_path = NULL) {
$this->authenticated = FALSE;
return FALSE;
}
}