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; ...@@ -14,42 +14,46 @@ namespace SimpleSAML\Module\exampleauth\Auth\Source;
class StaticSource extends \SimpleSAML\Auth\Source class StaticSource extends \SimpleSAML\Auth\Source
{ {
/** /**
* The attributes we return. * The attributes we return.
*/ */
private $attributes; private $attributes;
/**
* Constructor for this authentication source. /**
* * Constructor for this authentication source.
* @param array $info Information about this authentication source. *
* @param array $config Configuration. * @param array $info Information about this authentication source.
*/ * @param array $config Configuration.
public function __construct($info, $config) */
{ public function __construct($info, $config) {
assert(is_array($info)); assert(is_array($info));
assert(is_array($config)); assert(is_array($config));
// Call the parent constructor first, as required by the interface // Call the parent constructor first, as required by the interface
parent::__construct($info, $config); parent::__construct($info, $config);
// Parse attributes
try { // Parse attributes
$this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config); try {
} catch (\Exception $e) { $this->attributes = \SimpleSAML\Utils\Attributes::normalizeAttributesArray($config);
throw new \Exception('Invalid attributes for authentication source '. } catch (\Exception $e) {
$this->authId.': '.$e->getMessage()); 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. /**
*/ * Log in using static attributes.
public function authenticate(&$state) *
{ * @param array &$state Information about the current authentication.
assert(is_array($state)); */
$state['Attributes'] = $this->attributes; 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