Transforming User ID to match Login ID
To transform the userID to match the login ID
- In the left navigation panel of the Add Realm or Edit Realm page, click Authentication.
- In the User ID Transformation field, specify a required transformation type.
- Click Save.
The following table lists the userID transformation options available in the UserID Transformations list:
Transformation | Description |
---|---|
None | Displays the entered userID without any transformation. |
RemoveBMCDomain | Displays the userID without the suffix. |
RemoveDomain | Displays the userID without the prefix <domain>. Example: companyname\userid is transformed to userID. |
RemoveEMailDomain | Displays userID without the suffix@<anyemaildomain>. |
ToLowerCase | Displays userID after converting it to lower case. Example: UserID is transformed to userid. |
ToUpperCase | Displays userID after converting it to upper case. Example: userid is transformed to USERID. |
To specify a custom userID to match the login ID
- In the left navigation panel of the Add Realm or Edit Realm page, click Authentication.
- In the Custom Expression field, specify your value in the following format "userId + {value}".
For example, by using the #userId + "@bmc.com" expression, you construct Mary@bmc.com. - Click Save.
You can specify a custom userID ин using the predefined string functions. The list of Java string functions and their description is displayed in the following table:
Function | Description |
---|---|
strip() | Returns a string whose value is this string, with all leading and trailing white space removed. |
substring(int beginIndex) | Returns a string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. |
substring(int beginIndex, int endIndex) | Returns a string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. |
toLowerCase() | Converts all of the characters in this String to lower case. |
toUpperCase() | Converts all of the characters in this String to upper case. |
split(String regex) | Splits this string around matches of the given regular expression. |
replace(String target, String replacement) | Returns a string resulting from replacing all occurrences of target in this string with replacement. |
The following table represents examples of using string functions.
Expression | Current value | Transformed value |
---|---|---|
#userId.split('@')[0] | user1@example.com | user1 |
#userId.split('@')[0].toUpperCase() | user1@example.com | USER1 |
#userId.replace("@example.com", "@abc.com") | user1@example.com | user1@abc.com |
#userid.substring(2) | p_user12345 | user12345 |
#userid.substring(4, 9) + #userid.substring(0, 4) | user12345 | 12345user |