Skip to content

Commit af10544

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/azure-docs-pr (branch live)
2 parents 6bfead3 + a662406 commit af10544

File tree

163 files changed

+2107
-1187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+2107
-1187
lines changed

articles/active-directory-b2c/integer-transformations.md

Lines changed: 132 additions & 3 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: 09/10/2018
12+
ms.date: 07/21/2021
1313
ms.author: mimart
1414
ms.subservice: B2C
1515
---
@@ -20,14 +20,143 @@ ms.subservice: B2C
2020

2121
This article provides examples for using the integer claims transformations of the Identity Experience Framework schema in Azure Active Directory B2C (Azure AD B2C). For more information, see [ClaimsTransformations](claimstransformations.md).
2222

23+
## AdjustNumber
24+
25+
Increases or decreases a numeric claim and return a new claim.
26+
27+
| Item | TransformationClaimType | Data Type | Notes |
28+
| ---- | ----------------------- | --------- | ----- |
29+
| InputClaim | inputClaim | int | The claim type, which contains the number to increase or decrease. If the `inputClaim` claim value is null, the default of 0 is used. |
30+
| InputParameter | Operator | string | Possible values: `INCREMENT` (default), or `DECREMENT`.|
31+
| OutputClaim | outputClaim | int | The claim type that is produced after this claims transformation has been invoked. |
32+
33+
Use this claim transformation to increase or decrease a numeric claim value.
34+
35+
```xml
36+
<ClaimsTransformation Id="UpdateSteps" TransformationMethod="AdjustNumber">
37+
<InputClaims>
38+
<InputClaim ClaimTypeReferenceId="steps" TransformationClaimType="inputClaim" />
39+
</InputClaims>
40+
<InputParameters>
41+
<InputParameter Id="Operator" DataType="string" Value="INCREMENT" />
42+
</InputParameters>
43+
<OutputClaims>
44+
<OutputClaim ClaimTypeReferenceId="steps" TransformationClaimType="outputClaim" />
45+
</OutputClaims>
46+
</ClaimsTransformation>
47+
```
48+
49+
### Example 1
50+
51+
- Input claims:
52+
- **inputClaim**: 1
53+
- Input parameters:
54+
- **Operator**: INCREMENT
55+
- Output claims:
56+
- **outputClaim**: 2
57+
58+
### Example 2
59+
60+
- Input claims:
61+
- **inputClaim**: NULL
62+
- Input parameters:
63+
- **Operator**: INCREMENT
64+
- Output claims:
65+
- **outputClaim**: 1
66+
67+
68+
## AssertNumber
69+
70+
Determines whether a numeric claim is greater, lesser, equal, or not equal to a number.
71+
72+
| Item | TransformationClaimType | Data Type | Notes |
73+
| ---- | ----------------------- | --------- | ----- |
74+
| InputClaim | inputClaim | int | The first numeric claim to compare whether it is greater, lesser, equal, or not equal than the second number. Null value throws an exception. |
75+
| InputParameter | CompareToValue | boolean | The second number to compare whether it is greater, lesser, equal, or not equal than the first number. |
76+
| InputParameter | Operator | string | Possible values: `LESSTHAN`, `GREATERTHAN`, `GREATERTHANOREQUAL`, `LESSTHANOREQUAL`, `EQUAL`, `NOTEQUAL`. |
77+
| InputParameter | throwError | boolean | Specifies whether this assertion should throw an error if the comparison result is `true`. Possible values: `true` (default), or `false`. <br />&nbsp;<br />When set to `true` (Assertion mode), and the comparison result is `true`, an exception will be thrown. When set to `false` (Evaluation mode), the result is a new boolean claim type with a value of `true`, or `false`.|
78+
| OutputClaim | outputClaim | boolean | If `ThrowError` is set to `false`, this output claim contains `true`, or `false` according to the comparison result. |
79+
80+
### Assertion mode
81+
82+
When `throwError` input parameter is `true` (default), the **AssertNumber** claims transformation is always executed from a [validation technical profile](validation-technical-profile.md) that is called by a [self-asserted technical profile](self-asserted-technical-profile.md).
83+
84+
The **AssertNumberError** self-asserted technical profile metadata controls the error message that the technical profile presents to the user. The error messages can be [localized](localization-string-ids.md#claims-transformations-error-messages).
85+
86+
```xml
87+
<TechnicalProfile Id="SelfAsserted-LocalAccountSignin-Email">
88+
<Metadata>
89+
<Item Key="AssertNumberError">You've reached the maximum logon attempts</Item>
90+
</Metadata>
91+
...
92+
</TechnicalProfile>
93+
```
94+
95+
For more information how to call the claims transformation in an assertion mode, see [AssertStringClaimsAreEqual](string-transformations.md#assertstringclaimsareequal), [AssertBooleanClaimIsEqualToValue](boolean-transformations.md#assertbooleanclaimisequaltovalue), and [AssertDateTimeIsGreaterThan](date-transformations.md#assertdatetimeisgreaterthan) claims transformations.
96+
97+
### Assertion mode example
98+
99+
The following example asserts the number of attempts is over five. The claims transformation throws an error according to the comparison result.
100+
101+
```xml
102+
<ClaimsTransformation Id="isOverLimit" TransformationMethod="AssertNumber">
103+
<InputClaims>
104+
<InputClaim ClaimTypeReferenceId="attempts" TransformationClaimType="inputClaim" />
105+
</InputClaims>
106+
<InputParameters>
107+
<InputParameter Id="Operator" DataType="string" Value="GREATERTHAN" />
108+
<InputParameter Id="CompareToValue" DataType="int" Value="5" />
109+
<InputParameter Id="throwError" DataType="boolean" Value="true" />
110+
</InputParameters>
111+
</ClaimsTransformation>
112+
```
113+
114+
- Input claims:
115+
- **inputClaim**: 10
116+
- Input parameters:
117+
- **Operator**: GREATERTHAN
118+
- **CompareToValue**: 5
119+
- **throwError**: true
120+
- Result: Error thrown
121+
122+
### Evaluation mode example
123+
124+
The following example evaluates whether the number of attempts is over five. The output claim contains a boolean value according to the comparison result. The claims transformation will not throw an error.
125+
126+
```xml
127+
<ClaimsTransformation Id="isOverLimit" TransformationMethod="AssertNumber">
128+
<InputClaims>
129+
<InputClaim ClaimTypeReferenceId="attempts" TransformationClaimType="inputClaim" />
130+
</InputClaims>
131+
<InputParameters>
132+
<InputParameter Id="Operator" DataType="string" Value="GREATERTHAN" />
133+
<InputParameter Id="CompareToValue" DataType="int" Value="5" />
134+
<InputParameter Id="throwError" DataType="boolean" Value="false" />
135+
</InputParameters>
136+
<OutputClaims>
137+
<OutputClaim ClaimTypeReferenceId="attemptsCountExceeded" TransformationClaimType="outputClaim" />
138+
</OutputClaims>
139+
</ClaimsTransformation>
140+
```
141+
142+
- Input claims:
143+
- **inputClaim**: 10
144+
- Input parameters:
145+
- **Operator**: GREATERTHAN
146+
- **CompareToValue**: 5
147+
- **throwError**: false
148+
- Output claims:
149+
- **outputClaim**: true
150+
151+
23152
## ConvertNumberToStringClaim
24153

25154
Converts a long data type into a string data type.
26155

27156
| Item | TransformationClaimType | Data Type | Notes |
28157
| ---- | ----------------------- | --------- | ----- |
29-
| InputClaim | inputClaim | long | The ClaimType to convert to a string. |
30-
| OutputClaim | outputClaim | string | The ClaimType that is produced after this ClaimsTransformation has been invoked. |
158+
| InputClaim | inputClaim | long | The claim type to convert to a string. |
159+
| OutputClaim | outputClaim | string | The claim type that is produced after this claims transformation has been invoked. |
31160

32161
In this example, the `numericUserId` claim with a value type of long is converted to a `UserId` claim with a value type of string.
33162

0 commit comments

Comments
 (0)