Views:

Applies To:

GroupID 8 and above - Self-Service

Summary:

Naming standards play a bigger role in your IT enterprise than you may think. When users are given access to Active Directory via the Self-Service portal, it becomes even more important.

GroupID administrators can enforce a naming convention for groups that are created using the Self-Service portal by defining regular expressions. This involves two main steps:

Create a display type

  1. In GroupID Management Console, select Self-Service > Portals > [Required portal] > Designs > [Required identity store].
  2. On the Custom Display Types tab, click Add in the Simple Types area.
  3. On the New Display Type dialog box, enter a name for the display type in the Name box. This name should reflect the purpose of the display type, for example, Regular Expression Policy 1.
  4. From the Type list, select the Textbox option and click OK.

  5. For GroupID 8.x:
    On clicking OK, the Text Display Type dialog box is displayed, where you can specify a regular expression.
     
    Default Value Specify a default value that will be displayed in the textbox.
    Regular Expression Specify a regular expression to perform a validation on the data entered in the textbox.
    Regular Expression Example Provide a sample string. It must be a valid string that meets the criteria set by the regular expression. This string will be shown as a standard sample for the users to follow.



    For GroupID 10.x:
    On clicking OK, a slightly different Text Display Type dialog box is displayed.

    Default Value Specify a default value that will be displayed in the textbox.
    Regular Expression Specify a regular expression to perform a validation on the data entered in the textbox.
    Error Message Type the text that would be displayed as an error message when a portal user enters data in the text box that does not conform to the regular expression.

  6. Click OK and save the display type.
    This new display type is listed in the Simple Types area along with the already defined display types.

Associate the display type with a field

The next step is to associate the display type with the required field. Let's suppose you want to associate the display type with the Group Name field on the Create Group wizard in the self-Service portal.

  1. In GroupID Management Console, select Self-Service > Portals > [Required portal] > Designs > [Required identity store].
  2. On the Create Object tab, select Group from the Select Directory Object drop-down list.
  3. In the Name list, select General and click Edit.
  4. On the Edit Design Category dialog box, select Group name in the Fields area and click Edit.
  5. On the Edit Field dialog box, select the display type you created (namely, Regular Expression Policy 1) from the Display Type drop-down list.
  6. Click OK to close the dialog boxes and then save the changes.
    Now this display type is linked to the Group name field on the Create Group wizard in the portal.

Final Result:

The naming convention we defined using a regular expression was to ensure that group names only contain alphabetic characters (lowercase and uppercase), without spaces. So when a user tries to enter a group name with spaces, the portal will not validate the name and will display the standard example that we specified. It is as follows:

Some examples of regular expressions are discussed below.

Example 1:

Ensure that the desired field only contains alphabetic characters (lowercase & uppercase) and numeric digits (0-9). In addition, the length must be constrained between 1 to 25 characters.

Regular Expression:
^[A-Za-z0-9-]{1,25}$

Example 2:

Ensure that the desired field only contains alphabetic characters (lowercase & uppercase), numeric digits (0-9), underscores (_), hyphens (-), asterisks (*), commas (,) and space characters. In addition, the length is constrained between 1 to 30 characters.

Regular Expression:
^[A-Za-z0-9-,_*\s]{1,30}$

Example 3:

A phone number in North America starts with three numbers which represent the area code, followed by seven digits split into sections of three and four (which represent the local number), so the number looks like (555) 123-4567. We have been facing this problem where users do not follow the pattern or add an extra number at the end. We want to make sure that users follow the standard pattern while entering phone numbers.

Regular Expression:
^\ (\d\d\d\) \d\d\d-\d\d\d\d$

Example 4:

The following regular expression will accept telephone numbers in the format: 1 555 555 5555.

^[01]?[- .]?(\([2-9]\d{2}\)|[2-9]\d{2})[- .]?\d{3}[- .]?\d{4}$

References:

Comments (0)