PhenixID

PSD1061 – Control attribute syntax against filter

Fact

PhenixID Identity Manager 4.8.x and later

Situation

This control filter is used to manage allowed syntax for a configured attributes by using regex.

Some examples:

  • Do not allow less than 10 characters in an input control
  • Only allow A-Z, a-z and 0-9 as valid characters in an input control
  • Verify that date is in yyyy-MM-dd format

Solution

  1. Download PSD1061.zip
  2. Add class file to IM Configurator:
    1. Add the class file CheckAttributeSyntaxControlFilter.class to:
      [IMConfig Installation folder]\ext\class\psd
    2. Restart IM Configurator
  3. Add class file to IM Web:
    1. Add the class file CheckAttributeSyntaxControlFilter.class to:
      [IMWEB Installation folder]\customer\extension\class\psd
    2. If you have an earlier version than IM Web 5.0
      [IMWEB Installation folder]\webapps\phenixid\WEB-INF\classes\psd
    3. Restart IM Web
  4. Configure filter in IM Configurator
    Add this filter with the method checkAttribute as a pre-save filter for the control where the syntax should be checked. Like this:
  5. Configure 3 string parameters describe in examples below:

Example 1: Disallow all characters except A-ZÅÄÖa-zåäö0-9 –

Parameters Example
The regular expression .*[^A-ZÅÄÖa-zåäö0-9\ \-].*
true/false. True if the value should match the regex, false if it should not false
Error message to the user. This error message can be translated by using language files The value entered in the attribute does has incorrect syntax

Example 2: Check syntax is yyyy-MM-dd

Parameters Example
The regular expression ^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$
true/false. True if the value should match the regex, false if it should not true
Error message to the user. This error message can be translated by using language files Should be entered as yyyy-MM-dd

DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se