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
+45-4Lines changed: 45 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: celestedg
9
9
ms.service: active-directory
10
10
ms.workload: identity
11
11
ms.topic: reference
12
-
ms.date: 02/24/2020
12
+
ms.date: 03/30/2020
13
13
ms.author: mimart
14
14
ms.subservice: B2C
15
15
---
@@ -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**. 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). |
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:
@@ -63,7 +63,19 @@ The **Parameter** element contains the following attributes:
63
63
| ------- | ----------- | ----------- |
64
64
| Id | 1:1 | The identifier of the parameter. |
65
65
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:
67
79
68
80
```XML
69
81
<PredicateId="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
74
86
</Predicate>
75
87
```
76
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
+
77
97
The following example shows a `MatchesRegex` method with the parameter `RegularExpression` that specifies a regular expression:
78
98
79
99
```XML
@@ -84,6 +104,14 @@ The following example shows a `MatchesRegex` method with the parameter `RegularE
84
104
</Predicate>
85
105
```
86
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
+
87
115
The following example shows a `IncludesCharacters` method with the parameter `CharacterSet` that specifies the set of characters:
88
116
89
117
```XML
@@ -94,7 +122,16 @@ The following example shows a `IncludesCharacters` method with the parameter `Ch
94
122
</Predicate>
95
123
```
96
124
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`.
98
135
99
136
```XML
100
137
<PredicateId="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
- 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