Skip to content

Conversation

@ghalse
Copy link
Contributor

@ghalse ghalse commented Jan 8, 2026

The SAML XML parser ignores any <saml:AttributeValue> statements within a <md:RequestedAttribute> element. However, the SAML metadata spec clearly allows these (cf 2.4.4.2) and SimpleSAMLphp's own core:AttributeLimit filter can use them to limit attribute values.

This change adds support for parsing the child AttributeValue elements, and renders them as an associative array as documented by core:AttributeLimit. It also interoperates with SANLBuilder to re-render the XML version of the metadata correctly with any AttributeValues intact.

The lack of support for AttributeValue in the SAMLParser class is the root cause of simplesamlphp/simplesamlphp-module-metarefresh#51. Thus, fixing this also resolves that issue.

There are also some minor cosmetic changes to variable names to make their use in parseAttributeConsumerService() consistent with the handling of EntityAttributes in processExtensions().

@ghalse
Copy link
Contributor Author

ghalse commented Jan 8, 2026

Unlike #2582, this version doesn't cleanly run with PHPUnit. However, that's for unrelated reasons (the error is to do with SAML2\SignedElementHelper) which I'm assuming is still work in progress. The syntax matches EntityAttributes and seems to be correct. The logic is the same as #2582 with the call to getAttributeValue() changed to getAttributeValues() from the newer SAML library.

@monkeyiq monkeyiq merged commit ff03fa5 into simplesamlphp:master Feb 5, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants