Skip to content

Commit 64fca25

Browse files
committed
Silently continue on missing identifyingAttribute
1 parent 1cec777 commit 64fca25

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

modules/core/lib/Auth/Process/TargetedID.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use SAML2\XML\saml\NameID;
1010
use SimpleSAML\Assert\Assert;
1111
use SimpleSAML\Auth;
12+
use SimpleSAML\Logger;
1213
use SimpleSAML\Utils;
1314

1415
/**
@@ -100,14 +101,16 @@ public function setConfigUtils(Utils\Config $configUtils): void
100101
public function process(array &$state): void
101102
{
102103
Assert::keyExists($state, 'Attributes');
103-
Assert::keyExists(
104-
$state['Attributes'],
105-
$this->identifyingAttribute,
106-
sprintf(
107-
"core:TargetedID: Missing attribute '%s', which is needed to generate the targeted ID.",
108-
$this->identifyingAttribute
109-
)
110-
);
104+
if (!array_key_exists($this->identifyingAttribute, $state['Attributes'])) {
105+
Logger::warning(
106+
sprintf(
107+
"core:TargetedID: Missing attribute '%s', which is needed to generate the TargetedID.",
108+
$this->identifyingAttribute
109+
)
110+
);
111+
112+
return;
113+
}
111114

112115
$userID = $state['Attributes'][$this->identifyingAttribute][0];
113116
Assert::stringNotEmpty($userID);

0 commit comments

Comments
 (0)