When using the following expression with a single-valued attribute in a User Directory configuration, it works perfectly:
(attribute='value') ? 'true' : 'false'
When attempting to apply it to a multivalued attribute, it doesn't seem to operate correctly and consistently returns 'false'.
The documentation provides a lot of operators (1), which in combination, will help to find the right expression to fit the business needs.
For instance, having a multivalued attribute called givenName, for debugging purpose, create a response to send the value of the custom attribute defined in the User Directory.
User Directory
| Attribute | Value | |--------------+--------------------------| | cn | <name1name> | | sn | <name1name> | | givenName | <name1name> | | givenName | <name2name> | | uid | <name1name> |
Attribute Mapping List
| Name | Description | |-------------------+-------------| | <customAttribute> | |
Name: <customAttribute> Expression: (givenName CONTAINS "name1name") ? "YES" : "NO"
Response:
| Agent Type Attribute Name | Value | |-------------------------------+-----------------------------------------------------| | WebAgent-HTTP-Header-Variable | <customAttribute>=<%userattr="<customAttribute>" %> |
The custom attribute called <customAttribute> is set in the User Directory, with the following expressions, to find the correct one:
Try each of them separately, to see the value the Response sends:
The expression is prepared for use in a Policy Expression to determine if the user has access to the resource or not.