Overview
The basic:AttributeValueRegex
type matches attributes values against the supplied Java Regular Expression
Confusingly, the basic:AttributeValueRegex
type can be a Matcher or a PolicyRequirement.
- If no
attributeID
attribute is specified then it is a Matcher (returning that value if it is present amongst the values, and the empty set otherwise) - If an
attributeID
attribute is specified then it is a PolicyRule (returning true if that that is present amongst the values for the specified attribute).
Schema Name
The basic:AttributeValueRegex
type is defined by the urn:mace:shibboleth:2.0:afp:mf:basic
schema, which can be located at http://shibboleth.net/schema/idp/shibboleth-afp-mf-basic.xsd.
Attributes
Two attributes may be specified
Name | Type | Default | Description |
---|---|---|---|
attributeID | String | none | If this is present then this is a PolicyRule returning true if the attribute of this ID contains a value with matches If this is not present then this is a Matcher returning any value that match, and the empty set otherwise |
regex | Java RegExp | required | The regular expression to match against |
Child Elements12
None
Examples
<afp:PolicyRequirementRule xsi:type="basic:AttributeValueRegex" regex="^hn.*$" attributeID="uid"/>
Apply this rule if the attribute "uid" contains at least one value which starts with "hn"
<afp:AttributeRule attributeID="uid"> <afp:PermitValueRule xsi:type="basic:AttributeValueRegex" regex="^hn.*$" /> </afp:AttributeRule>
Add any values of the attribute "uid" with start "hn" to its permitted values list.
<afp:PolicyRequirementRule xsi:type="basic:AttributeValueRegex" regex="^hn.*$"/>
Apply this rule if any attribute contains a value which starts with hn
<afp:AttributeRule attributeID="email"> <afp:PermitValueRule xsi:type="basic:AttributeValueRegex" regex="^hn.*$" attributeID="uid"/> </afp:AttributeRule>
If the attribute "uid" contains any value which starts hn then release all values of "email" .