Skip to content

Commit

Permalink
Fix: RequestSecurityTokenType can contains saml-elements
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jan 28, 2024
1 parent 6300c9a commit 742a430
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/XML/wst/AbstractRequestSecurityTokenType.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use DOMElement;
use SimpleSAML\Assert\Assert;
use SimpleSAML\SAML2\XML\saml\Assertion;
use SimpleSAML\WSSecurity\Constants as C;
use SimpleSAML\WSSecurity\XML\wsp\AppliesTo;
use SimpleSAML\WSSecurity\XML\wsp\Policy;
Expand Down Expand Up @@ -95,6 +96,11 @@ public static function fromXML(DOMElement $xml): static
foreach ($xml->childNodes as $child) {
if (!($child instanceof DOMElement)) {
continue;
} elseif ($child->namespaceURI === C::NS_SAML) {
$children[] = match ($child->localName) {
'Assertion' => Assertion::fromXML($child),
default => Chunk::fromXML($child),
};
} elseif ($child->namespaceURI === C::NS_TRUST) {
$children[] = match ($child->localName) {
'AllowPostdating' => AllowPostdating::fromXML($child),
Expand Down

0 comments on commit 742a430

Please sign in to comment.