You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory-b2c/predicates.md
+36-7Lines changed: 36 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ The **Predicate** element contains the following attributes:
41
41
| Attribute | Required | Description |
42
42
| --------- | -------- | ----------- |
43
43
| Id | Yes | An identifier that's used for the predicate. Other elements can use this identifier in the policy. |
44
-
| Method | Yes | The method type to use for validation. Possible values: **IsLengthRange**, **MatchesRegex**, **IncludesCharacters**, or **IsDateRange**. |
44
+
| Method | Yes | The method type to use for validation. Possible values: [IsLengthRange](#IsLengthRange), [MatchesRegex](#MatchesRegex), [IncludesCharacters](#IncludesCharacters), or [IsDateRange](#IsDateRange). |
45
45
| HelpText | No | An error message for users if the check fails. This string can be localized using the [language customization](localization.md)|
46
46
47
47
The **Predicate** element contains the following elements:
@@ -65,17 +65,17 @@ The **Parameter** element contains the following attributes:
65
65
66
66
### Predicate methods
67
67
68
-
### IsLengthRange
68
+
####IsLengthRange
69
69
70
-
The **IsLengthRange** value checks whether the length of a string claim value is within the range of minimum and maximum parameters specified. The Predicate element supports the following parameters:
70
+
The IsLengthRange method checks whether the length of a string claim value is within the range of minimum and maximum parameters specified. The predicate element supports the following parameters:
71
71
72
72
| Parameter | Required | Description |
73
73
| ------- | ----------- | ----------- |
74
-
| Maximum | Yes | The minimum number of characters that must be entered. |
75
-
| Minimum | Yes | The maximum number of characters that can be entered. |
74
+
| Maximum | Yes | The maximum number of characters that can be entered. |
75
+
| Minimum | Yes | The minimum number of characters that must be entered. |
76
76
77
77
78
-
The following example shows a `IsLengthRange` method with the parameters `Minimum` and `Maximum` that specify the length range of the string:
78
+
The following example shows a IsLengthRange method with the parameters `Minimum` and `Maximum` that specify the length range of the string:
79
79
80
80
```XML
81
81
<PredicateId="IsLengthBetween8And64"Method="IsLengthRange"HelpText="The password must be between 8 and 64 characters.">
@@ -86,6 +86,14 @@ The following example shows a `IsLengthRange` method with the parameters `Minimu
86
86
</Predicate>
87
87
```
88
88
89
+
#### MatchesRegex
90
+
91
+
The MatchesRegex method checks whether a string claim value matches a regular expression. The predicate element supports the following parameters:
92
+
93
+
| Parameter | Required | Description |
94
+
| ------- | ----------- | ----------- |
95
+
| RegularExpression | Yes | The regular expression pattern to match. |
96
+
89
97
The following example shows a `MatchesRegex` method with the parameter `RegularExpression` that specifies a regular expression:
90
98
91
99
```XML
@@ -96,6 +104,14 @@ The following example shows a `MatchesRegex` method with the parameter `RegularE
96
104
</Predicate>
97
105
```
98
106
107
+
#### IncludesCharacters
108
+
109
+
The IncludesCharacters method checks whether a string claim value contains a character set. The predicate element supports the following parameters:
110
+
111
+
| Parameter | Required | Description |
112
+
| ------- | ----------- | ----------- |
113
+
| CharacterSet | Yes | The set of characters that can be entered. For example, lowercase characters `a-z`, uppercase characters `A-Z`, digits `0-9`, or a list of symbols, such as `@#$%^&*\-_+=[]{}|\\:',?/~"();!`. |
114
+
99
115
The following example shows a `IncludesCharacters` method with the parameter `CharacterSet` that specifies the set of characters:
100
116
101
117
```XML
@@ -106,7 +122,16 @@ The following example shows a `IncludesCharacters` method with the parameter `Ch
106
122
</Predicate>
107
123
```
108
124
109
-
The following example shows a `IsDateRange` method with the parameters `Minimum` and `Maximum` that specify the date range with a format of `yyyy-MM-dd` and `Today`.
125
+
#### IsDateRange
126
+
127
+
The IsDateRange method checks whether a date claim value is between a range of minimum and maximum parameters specified. The predicate element supports the following parameters:
128
+
129
+
| Parameter | Required | Description |
130
+
| ------- | ----------- | ----------- |
131
+
| Maximum | Yes | The largest possible date that can be entered. The format of the date follows `yyyy-mm-dd` convention, or `Today`. |
132
+
| Minimum | Yes | The smallest possible date that can be entered. The format of the date follows `yyyy-mm-dd` convention, or `Today`.|
133
+
134
+
The following example shows a `IsDateRange` method with the parameters `Minimum` and `Maximum` that specify the date range with a format of `yyyy-mm-dd` and `Today`.
110
135
111
136
```XML
112
137
<PredicateId="DateRange"Method="IsDateRange"HelpText="The date must be between 1970-01-01 and today.">
@@ -396,3 +421,7 @@ In your claim type, add **PredicateValidationReference** element and specify the
- Learn how to [Configure password complexity using custom policies in Azure Active Directory B2C](custom-policy-password-complexity.md) using predicate validations.
0 commit comments