Juel expression doesn't work with multivalued attribute
search cancel

Juel expression doesn't work with multivalued attribute

book

Article ID: 369326

calendar_today

Updated On:

Products

SITEMINDER

Issue/Introduction


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'.

 

Resolution


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:

  1. Get all the values for givenName:

    GET("givenName")

    result:

    <customAttribute>: <name2name>^<name1name>

  2. Find the one matching name1*ame:

    FILTER(GET("givenName"), "name1*ame")

    result:

    <customAttribute>: name1name

  3. Make the search to return a boolean:

    FILTER(GET("givenName"), "name1*ame") LIKE "name1*ame" ? "YES" : "NO"

    result:

    <customAttribute>: YES 

The expression is prepared for use in a Policy Expression to determine if the user has access to the resource or not.     

 

Additional Information

 

  1. Operators