Skip to content

Commit 963ad66

Browse files
authored
Merge pull request #112134 from yoelhor/patch-36
Update string-transformations.md
2 parents 65b454a + daea472 commit 963ad66

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

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

Lines changed: 41 additions & 6 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: 03/16/2020
12+
ms.date: 04/21/2020
1313
ms.author: mimart
1414
ms.subservice: B2C
1515
---
@@ -365,7 +365,7 @@ Copies localized strings into claims.
365365

366366
| Item | TransformationClaimType | Data Type | Notes |
367367
| ---- | ----------------------- | --------- | ----- |
368-
| OutputClaim | The name of the localized string | string | List of claim types that is produced after this claims transformation has been invoked. |
368+
| OutputClaim | The name of the localized string | string | List of claim types that are produced after this claims transformation has been invoked. |
369369

370370
To use the GetLocalizedStringsTransformation claims transformation:
371371

@@ -611,13 +611,17 @@ Checks that a string claim `claimToMatch` and `matchTo` input parameter are equa
611611
| inputClaim | claimToMatch | string | The claim type, which is to be compared. |
612612
| InputParameter | matchTo | string | The regular expression to match. |
613613
| InputParameter | outputClaimIfMatched | string | The value to be set if strings are equal. |
614+
| InputParameter | extractGroups | boolean | [Optional] Specifies whether the Regex match should extract groups values. Possible values: `true`, or `false` (default). |
614615
| OutputClaim | outputClaim | string | If regular expression is match, this output claim contains the value of `outputClaimIfMatched` input parameter. Or null, if no match. |
615616
| OutputClaim | regexCompareResultClaim | boolean | The regular expression match result output claim type, which is to be set as `true` or `false` based on the result of matching. |
617+
| OutputClaim| The name of the claim| string | If the extractGroups input parameter set to true, list of claim types that are produced after this claims transformation has been invoked. The name of the claimType must match the Regex group name. |
616618

617-
For example, checks whether the provided phone number is valid, based on phone number regular expression pattern.
619+
### Example 1
620+
621+
Checks whether the provided phone number is valid, based on phone number regular expression pattern.
618622

619623
```XML
620-
<ClaimsTransformation Id="SetIsPhoneRegex" TransformationMethod="setClaimsIfRegexMatch">
624+
<ClaimsTransformation Id="SetIsPhoneRegex" TransformationMethod="SetClaimsIfRegexMatch">
621625
<InputClaims>
622626
<InputClaim ClaimTypeReferenceId="phone" TransformationClaimType="claimToMatch" />
623627
</InputClaims>
@@ -632,8 +636,6 @@ For example, checks whether the provided phone number is valid, based on phone n
632636
</ClaimsTransformation>
633637
```
634638

635-
### Example
636-
637639
- Input claims:
638640
- **claimToMatch**: "64854114520"
639641
- Input parameters:
@@ -643,6 +645,39 @@ For example, checks whether the provided phone number is valid, based on phone n
643645
- **outputClaim**: "isPhone"
644646
- **regexCompareResultClaim**: true
645647

648+
### Example 2
649+
650+
Checks whether the provided email address is valid, and return the email alias.
651+
652+
```XML
653+
<ClaimsTransformation Id="GetAliasFromEmail" TransformationMethod="SetClaimsIfRegexMatch">
654+
<InputClaims>
655+
<InputClaim ClaimTypeReferenceId="email" TransformationClaimType="claimToMatch" />
656+
</InputClaims>
657+
<InputParameters>
658+
<InputParameter Id="matchTo" DataType="string" Value="(?&lt;mailAlias&gt;.*)@(.*)$" />
659+
<InputParameter Id="outputClaimIfMatched" DataType="string" Value="isEmail" />
660+
<InputParameter Id="extractGroups" DataType="boolean" Value="true" />
661+
</InputParameters>
662+
<OutputClaims>
663+
<OutputClaim ClaimTypeReferenceId="validationResult" TransformationClaimType="outputClaim" />
664+
<OutputClaim ClaimTypeReferenceId="isEmailString" TransformationClaimType="regexCompareResultClaim" />
665+
<OutputClaim ClaimTypeReferenceId="mailAlias" />
666+
</OutputClaims>
667+
</ClaimsTransformation>
668+
```
669+
670+
- Input claims:
671+
- **claimToMatch**: "[email protected]"
672+
- Input parameters:
673+
- **matchTo**: `(?&lt;mailAlias&gt;.*)@(.*)$`
674+
- **outputClaimIfMatched**: "isEmail"
675+
- **extractGroups**: true
676+
- Output claims:
677+
- **outputClaim**: "isEmail"
678+
- **regexCompareResultClaim**: true
679+
- **mailAlias**: emily
680+
646681
## SetClaimsIfStringsAreEqual
647682

648683
Checks that a string claim and `matchTo` input parameter are equal, and sets the output claims with the value present in `stringMatchMsg` and `stringMatchMsgCode` input parameters, along with compare result output claim, which is to be set as `true` or `false` based on the result of comparison.

0 commit comments

Comments
 (0)