Skip to content
Snippets Groups Projects
Commit 6e54aff3 authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Fix namespace-issue

I had to rename the class because 'static' is a protected keyword, but forgot to rename the file
parent 02af510b
No related branches found
No related tags found
No related merge requests found
......@@ -14,42 +14,46 @@ namespace SimpleSAML\Module\exampleauth\Auth\Source;
class StaticSource extends \SimpleSAML\Auth\Source
{
/**
* The attributes we return.
*/
private $attributes;
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config)
{
assert(is_array($info));
assert(is_array($config));
// Call the parent constructor first, as required by the interface
parent::__construct($info, $config);
// Parse attributes
try {
$this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config);
} catch (\Exception $e) {
throw new \Exception('Invalid attributes for authentication source '.
$this->authId.': '.$e->getMessage());
}
}
/**
* Log in using static attributes.
*
* @param array &$state Information about the current authentication.
*/
public function authenticate(&$state)
{
assert(is_array($state));
$state['Attributes'] = $this->attributes;
}
/**
* The attributes we return.
*/
private $attributes;
/**
* Constructor for this authentication source.
*
* @param array $info Information about this authentication source.
* @param array $config Configuration.
*/
public function __construct($info, $config) {
assert(is_array($info));
assert(is_array($config));
// Call the parent constructor first, as required by the interface
parent::__construct($info, $config);
// Parse attributes
try {
$this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config);
} catch (\Exception $e) {
throw new \Exception('Invalid attributes for authentication source ' .
$this->authId . ': ' . $e->getMessage());
}
}
/**
* Log in using static attributes.
*
* @param array &$state Information about the current authentication.
*/
public function authenticate(&$state) {
assert(is_array($state));
$state['Attributes'] = $this->attributes;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment