You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for filtering Subject Identifier Attributes #2479
SSP has support for generating the two "new" SAML subject identifier attributes in saml:SubjectID and saml:PairwiseID. However, it seems that the requirements signalling part of the specification was overlooked. This uses a dedicated EntityAttribute to signal which of the two subject identifiers the remote SP would like, separate from the normal RequestedAttribute mechanism.
core:AttributeLimit allows us to filter attributes based on RequestedAttributes (corresponding to the attributes entry in SSP form metadata). However there is not comparable mechanism to implement the logic described in the urn:oasis:names:tc:SAML:profiles:subject-id:req EntityAttribute.
This could be fixed by extending saml:SubjectID / saml:PairwiseID to respect the urn:oasis:names:tc:SAML:profiles:subject-id:req EntityAttribute if present, and only generate a subject identifier if it matched the request. Tt should probably always generate if no explicit request was present, and may need a boolean to force generation even when not requested?
I guess it could also be fixed by extending core:AttributeLimit to understand the EntityAttribute. This might make more sense to newcomers who expect that module to manage all attributes. But its also somewhat overstepping the core/saml boundary?
Additional context
SAML metadata signalling that it wants a subject identifier includes this:
OK, so I took a look at the specifications involved here and the only reason the EntityAttributes-signal was introduced is because the existing RequestedAttributes doesn't provide a mechanism to indicate 'one-or-the other' or 'neither'.
That being said, the SAML core specifications are still in effect here, since the subject-id specs don't describe the way a SAML entity should behave. It means even with a signal in the metadata, an SP must still add those attributes to the RequestedAttributes if it wants to receive them:
none: both MAY OPTIONALLY be present in the RequestedAttributes
subject-id/pairwise-id: one MUST be present in the RequestedAttributes as 'required'
any: both MUST be present in the RequestedAttributes as 'optional' and the Service Provider MUST ensure that at least on of them is provided. I feel it's the responsibility of the Service Provider to check if they receive what they ask for, but we could additionally make core:AttributeLimit smarter and already check this in the IDP.
The authproc-filters that generate the IDs can be made smarter to only generate if requested. The default behaviour if not specifically requested would be to just generate them.
Tasks:
Add signal + possible values to the saml2-library as constants
Added in saml2@v5.0.3
Add a signal-configuration to the SP-authsource config + to the remote IdP-config
This was actually already in place by configuring the EntityAttributes-setting.
Possibly add a feature-flag to pass signals through a proxy.
If the signal is set in the EntityAttributes, this MUST add the attributes to the RequestedAttributes dynamically as-per above logics IF RequestedAttributes is set at all. If not, do nothing
The SP-authsource MUST check the response in the 'any'-case for either of the IDs
The authproc-filters SHOULD NOT generate attributes that were not requested, but MUST generate if no signal was sent.
So it seems people interpret the specification saying:
This profile does not provide (nor preclude) any guidance around the use of the md:RequestedAttribute element for signaling requirements, but notably it is impossible without additional specification work to reflect the semantics of the any value defined above using that mechanism.
as meaning that you don't need to specify these in md:RequestedAttribute if you set the EntityAttribute.
Activity
tvdijen commentedon Jul 1, 2025
OK, so I took a look at the specifications involved here and the only reason the EntityAttributes-signal was introduced is because the existing RequestedAttributes doesn't provide a mechanism to indicate 'one-or-the other' or 'neither'.
That being said, the SAML core specifications are still in effect here, since the subject-id specs don't describe the way a SAML entity should behave. It means even with a signal in the metadata, an SP must still add those attributes to the RequestedAttributes if it wants to receive them:
The authproc-filters that generate the IDs can be made smarter to only generate if requested. The default behaviour if not specifically requested would be to just generate them.
Tasks:
Added in saml2@v5.0.3
This was actually already in place by configuring the EntityAttributes-setting.
@ghalse @monkeyiq Please read and let me know if you agree.
ghalse commentedon Jul 3, 2025
Just for some reference, I ran the following against the SPs from eduGAIN:
and got the following results:
One of those is our test service provider.
So it seems people interpret the specification saying:
as meaning that you don't need to specify these in md:RequestedAttribute if you set the EntityAttribute.