Regex Username Transformer
Description
This username transformer transforms a user name with a regular expression (regex). Specifically, it searches for the specified pattern and replaces all matches with the replacement string (using the method
replaceAll(replacement)). May be used by
Client Certificate (X.509) Request Authentication SSI Passwordless Authentication Step Authenticator-based One-Shot Target Application Adminapp REST API Configuration Public Self-Service Flow SSI Authentication Step Admin SSO Ticket Request Authentication OAuth 2.0/OIDC Authorization Server Authentication Flow Administrators Configuration One-Shot Authentication Flow Basic Auth HTTP Header Extractor RADIUS Authenticator SAML 2.0 Flow SP Kerberos User Definition Basic Auth Request Authentication Session-less REST Endpoints Credential Data Certificate Matcher OTP Check via RADIUS Step Transaction Approval Flow Radius Authentication Service SSO Ticket Request Authentication Certificate Authenticator Kerberos SPNEGO Extractor
Properties
Regex (
regex) Description
Regular expression to match the input user name or part of it. The expression '(.+)' matches the whole string and saves it as a group which can be referenced as '$1' in the replacement expression.
Notice: To match any string, always use "(.+)", and never "(.*)" since the latter also matches against the empty string and thus the replacement will be applied twice.
- To add the prefix 'SubjectEmail:', use Regex='^(.+)$' and Replacement='SubjectEmail:$1'.
- To remove all whitespace from the user name, use Regex='\s' and Replacement=''.
- To remove the domain part of an email address, use Regex='@.*$' and Replacement=''.
Attributes
RegEx
Mandatory
Replacement (
replacement) Description
The expression to replace the matched text with. The first matching group of the regex is denoted '$1'.
Attributes
String
Optional
Stop After Successful Transformation (
stopAfterSuccessfulTransformation) Description
With this flag the chaining of username transformers can be interrupted. If it is enabled and the regular expression matched the user name (no matter whether the replacement actually resulted in a different username), following username transformers are not executed.
Attributes
Boolean
Optional
Default value
false
YAML Template (with default values)
type: RegexUsernameTransformer
id: RegexUsernameTransformer-xxxxxx
displayName:
comment:
properties:
regex:
replacement:
stopAfterSuccessfulTransformation: false