Skip to content

Commit ee2b959

Browse files
committed
Supported predicate methods + next steps
1 parent 2a51f2d commit ee2b959

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

articles/active-directory-b2c/predicates.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The **Predicate** element contains the following attributes:
4141
| Attribute | Required | Description |
4242
| --------- | -------- | ----------- |
4343
| 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). |
4545
| HelpText | No | An error message for users if the check fails. This string can be localized using the [language customization](localization.md) |
4646

4747
The **Predicate** element contains the following elements:
@@ -65,17 +65,17 @@ The **Parameter** element contains the following attributes:
6565

6666
### Predicate methods
6767

68-
### IsLengthRange
68+
#### IsLengthRange
6969

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:
7171

7272
| Parameter | Required | Description |
7373
| ------- | ----------- | ----------- |
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. |
7676

7777

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:
7979

8080
```XML
8181
<Predicate Id="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
8686
</Predicate>
8787
```
8888

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+
8997
The following example shows a `MatchesRegex` method with the parameter `RegularExpression` that specifies a regular expression:
9098

9199
```XML
@@ -96,6 +104,14 @@ The following example shows a `MatchesRegex` method with the parameter `RegularE
96104
</Predicate>
97105
```
98106

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 `@#$%^&amp;*\-_+=[]{}|\\:',?/~"();!`. |
114+
99115
The following example shows a `IncludesCharacters` method with the parameter `CharacterSet` that specifies the set of characters:
100116

101117
```XML
@@ -106,7 +122,16 @@ The following example shows a `IncludesCharacters` method with the parameter `Ch
106122
</Predicate>
107123
```
108124

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`.
110135

111136
```XML
112137
<Predicate Id="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
396421
<PredicateValidationReference Id="CustomDateRange" />
397422
</ClaimType>
398423
```
424+
425+
## Next steps
426+
427+
- 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

Comments
 (0)