Update the SP and IdP URIs to pass the URI regex.#2349
Merged
monkeyiq merged 2 commits intosimplesamlphp:masterfrom Dec 16, 2024
Merged
Conversation
These were all failing because of "eugeneIdP" is not a SAML2-compliant URI It seems that adding in the colon makes these a compliant test. The regex that was failing things is /^([a-z][a-z0-9\+\-\.]+[:])/i which is not anchored at both ends, so it seems you can have whatever you want after the colon. As long as there is one with a limited prefix.
Contributor
Author
|
If this is merged I might expand things to other tests to try to lower the overall fail count a bit. |
tvdijen
requested changes
Dec 11, 2024
Contributor
Author
|
Forcing one of these to fail again the backtrace is as follows. NameIDType.php:41 / 42 (depending on if it is an invalid entity on sp or idp) After a bit of digging I see there is an |
Contributor
Author
|
I have updated the entity ids here. I guess the regex used here is to try to catch very vague values being used for entities. |
monkeyiq
added a commit
to kwessel/simplesamlphp
that referenced
this pull request
Dec 15, 2024
These entity ids were copied from the test that I then updated which lead to much better values for test idp and sp entities. I am updating these entities here inline with the comment at simplesamlphp#2349 (review)
monkeyiq
added a commit
that referenced
this pull request
Dec 15, 2024
) * New 'identifyingAttribute option for SAML Attribute NameID filter Allow a new option in place of identifyingAttribute called identifyingAttributes. This option expects an array of attribute names. The first one in the list that's available in the attributes being released to the SP will be used. This is particularly useful in the hosted IdP configuration. One can specify multiple attribute names in order of precedence, and the IdP will release the first one from that list to the SP that's in the SP's 'attributes' array. This avoids having to define a new authproc filter for each SP that needs a different value than the single one that was previously specified using 'identifyingAttribute'. The change still supports identifyingAttribute option which will be used instead of the new option if both are set. * Throw error when AttributeNameID filter has both identifyingAttribute and identifyingAttributes set * identifyingAttributes clean-up per PR comments * Cleaned up logic for finding a value for the nameID * Corrected bug when $value was empty at end of loop * add a test for the AttributeNameID using an array of attributes * lint * Update AttributeNameIDTest.php These entity ids were copied from the test that I then updated which lead to much better values for test idp and sp entities. I am updating these entities here inline with the comment at #2349 (review) * Update nameid.md Mention that these are mutex options. * Update nameid.md lint --------- Co-authored-by: Ben Martin <monkeyiq@users.sourceforge.net> Co-authored-by: monkeyiq <monkeyiq@gmail.com>
monkeyiq
added a commit
that referenced
this pull request
Dec 15, 2024
) * New 'identifyingAttribute option for SAML Attribute NameID filter Allow a new option in place of identifyingAttribute called identifyingAttributes. This option expects an array of attribute names. The first one in the list that's available in the attributes being released to the SP will be used. This is particularly useful in the hosted IdP configuration. One can specify multiple attribute names in order of precedence, and the IdP will release the first one from that list to the SP that's in the SP's 'attributes' array. This avoids having to define a new authproc filter for each SP that needs a different value than the single one that was previously specified using 'identifyingAttribute'. The change still supports identifyingAttribute option which will be used instead of the new option if both are set. * Throw error when AttributeNameID filter has both identifyingAttribute and identifyingAttributes set * identifyingAttributes clean-up per PR comments * Cleaned up logic for finding a value for the nameID * Corrected bug when $value was empty at end of loop * add a test for the AttributeNameID using an array of attributes * lint * Update AttributeNameIDTest.php These entity ids were copied from the test that I then updated which lead to much better values for test idp and sp entities. I am updating these entities here inline with the comment at #2349 (review) * Update nameid.md Mention that these are mutex options. * Update nameid.md lint --------- Co-authored-by: Ben Martin <monkeyiq@users.sourceforge.net> Co-authored-by: monkeyiq <monkeyiq@gmail.com>
Member
|
Yes, SAML 2.0 entities are defined as URIs and from the top of my head they have to be absolute URIs, which leaves us with URNs and URLs. The test-values were neither of those. |
tvdijen
approved these changes
Dec 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These were all failing because of
"eugeneIdP" is not a SAML2-compliant URI
It seems that adding in the colon makes these a compliant test.
The regex that was failing things is
/^([a-z][a-z0-9+-.]+[:])/i
which is not anchored at both ends, so it seems you can have whatever you want after the colon. As long as there is one with a limited prefix.
I discovered this when making the AttributeNameIDTest for pr 2260. It may also cause other tests to fail creating a bunch of smoke around the harder tests to get working.