Improvements in handling attribute definitions and requested attributes in MetadataRequestedAttributesAttributeReleasePolicy
Hi, I created pull request https://github.com/apereo/cas/pull/5124
I would like to break it to 2 separate patches and submit it to master branch.
Could you comment on these proposed changes?
1. Add support for getRequestedDefinitions to MetadataRequestedAttributesAttributeReleasePolicy.
This change is a continuation of https://github.com/apereo/cas/pull/5051, which creates attributes when requested based on attribute definitions.
2. Change of getAttributesForSamlRegisteredService in MetadataRequestedAttributesAttributeReleasePolicy.
Instead of selecting attributes for release using RequestedAttributesName or FriendlyName provided in SP metadata:
- try to search for SamlIdPAttributeDefinition in AttributeDefinitionStore using urn provided Name attribute of RequestedAttribute , - if such SamlIdPAttributeDefinition exists, then use the key provided in this attribute definition to search and release user attribute, - if above fails, then try to search for user attribute using RequestedAttributeFriendlyName.
Sample RequestedAttribute definition in SP metadata looks like this: