Skip to content

Commit 5cd561b

Browse files
authored
Merge pull request #109474 from yoelhor/patch-24
Update predicates.md
2 parents 6dd7f42 + 5fd7280 commit 5cd561b

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

articles/active-directory-b2c/predicates.md

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ manager: celestedg
99
ms.service: active-directory
1010
ms.workload: identity
1111
ms.topic: reference
12-
ms.date: 02/24/2020
12+
ms.date: 03/30/2020
1313
ms.author: mimart
1414
ms.subservice: B2C
1515
---
@@ -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**. The **IsLengthRange** value checks whether the length of a string claim value is within the range of minimum and maximum parameters specified. The **MatchesRegex** value checks whether a string claim value matches a regular expression. The **IncludesCharacters** value checks whether a string claim value contains a character set. The **IsDateRange** value checks whether a date claim value is between a range of minimum and maximum parameters specified. |
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:
@@ -63,7 +63,19 @@ The **Parameter** element contains the following attributes:
6363
| ------- | ----------- | ----------- |
6464
| Id | 1:1 | The identifier of the parameter. |
6565

66-
The following example shows a `IsLengthRange` method with the parameters `Minimum` and `Maximum` that specify the length range of the string:
66+
### Predicate methods
67+
68+
#### IsLengthRange
69+
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+
72+
| Parameter | Required | Description |
73+
| ------- | ----------- | ----------- |
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+
77+
78+
The following example shows a IsLengthRange method with the parameters `Minimum` and `Maximum` that specify the length range of the string:
6779

6880
```XML
6981
<Predicate Id="IsLengthBetween8And64" Method="IsLengthRange" HelpText="The password must be between 8 and 64 characters.">
@@ -74,6 +86,14 @@ The following example shows a `IsLengthRange` method with the parameters `Minimu
7486
</Predicate>
7587
```
7688

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

7999
```XML
@@ -84,6 +104,14 @@ The following example shows a `MatchesRegex` method with the parameter `RegularE
84104
</Predicate>
85105
```
86106

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+
87115
The following example shows a `IncludesCharacters` method with the parameter `CharacterSet` that specifies the set of characters:
88116

89117
```XML
@@ -94,7 +122,16 @@ The following example shows a `IncludesCharacters` method with the parameter `Ch
94122
</Predicate>
95123
```
96124

97-
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`.
98135

99136
```XML
100137
<Predicate Id="DateRange" Method="IsDateRange" HelpText="The date must be between 1970-01-01 and today.">
@@ -384,3 +421,7 @@ In your claim type, add **PredicateValidationReference** element and specify the
384421
<PredicateValidationReference Id="CustomDateRange" />
385422
</ClaimType>
386423
```
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)