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

Silently continue on missing identifyingAttribute

parent 1cec777e
Branches
Tags
No related merge requests found
...@@ -9,6 +9,7 @@ use SAML2\Constants; ...@@ -9,6 +9,7 @@ use SAML2\Constants;
use SAML2\XML\saml\NameID; use SAML2\XML\saml\NameID;
use SimpleSAML\Assert\Assert; use SimpleSAML\Assert\Assert;
use SimpleSAML\Auth; use SimpleSAML\Auth;
use SimpleSAML\Logger;
use SimpleSAML\Utils; use SimpleSAML\Utils;
/** /**
...@@ -100,15 +101,17 @@ class TargetedID extends Auth\ProcessingFilter ...@@ -100,15 +101,17 @@ class TargetedID extends Auth\ProcessingFilter
public function process(array &$state): void public function process(array &$state): void
{ {
Assert::keyExists($state, 'Attributes'); Assert::keyExists($state, 'Attributes');
Assert::keyExists( if (!array_key_exists($this->identifyingAttribute, $state['Attributes'])) {
$state['Attributes'], Logger::warning(
$this->identifyingAttribute,
sprintf( sprintf(
"core:TargetedID: Missing attribute '%s', which is needed to generate the targeted ID.", "core:TargetedID: Missing attribute '%s', which is needed to generate the TargetedID.",
$this->identifyingAttribute $this->identifyingAttribute
) )
); );
return;
}
$userID = $state['Attributes'][$this->identifyingAttribute][0]; $userID = $state['Attributes'][$this->identifyingAttribute][0];
Assert::stringNotEmpty($userID); Assert::stringNotEmpty($userID);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment