Skip to content

Commit d435548

Browse files
authored
Merge pull request #105625 from yoelhor/patch-28
Update phone-number-claims-transformations.md
2 parents 0696126 + fc8cda2 commit d435548

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

articles/active-directory-b2c/phone-number-claims-transformations.md

Lines changed: 35 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: conceptual
12-
ms.date: 02/14/2020
12+
ms.date: 02/26/2020
1313
ms.author: marsma
1414
ms.subservice: B2C
1515
---
@@ -22,9 +22,39 @@ This article provides reference and examples for using the phone number claims t
2222

2323
[!INCLUDE [b2c-public-preview-feature](../../includes/active-directory-b2c-public-preview.md)]
2424

25+
## ConvertPhoneNumberClaimToString
26+
27+
Converts a `phoneNumber` data type into a `string` data type.
28+
29+
| Item | TransformationClaimType | Data Type | Notes |
30+
| ---- | ----------------------- | --------- | ----- |
31+
| InputClaim | phoneNumber | phoneNumber | The ClaimType to convert to a string. |
32+
| OutputClaim | phoneNumberString | string | The ClaimType that is produced after this claims transformation has been invoked. |
33+
34+
In this example, the cellPhoneNumber claim with a value type of `phoneNumber` is converted to a cellPhone claim with a value type of `string`.
35+
36+
```XML
37+
<ClaimsTransformation Id="PhoneNumberToString" TransformationMethod="ConvertPhoneNumberClaimToString">
38+
<InputClaims>
39+
<InputClaim ClaimTypeReferenceId="cellPhoneNumber" TransformationClaimType="phoneNumber" />
40+
</InputClaims>
41+
<OutputClaims>
42+
<OutputClaim ClaimTypeReferenceId="cellPhone" TransformationClaimType="phoneNumberString" />
43+
</OutputClaims>
44+
</ClaimsTransformation>
45+
```
46+
47+
### Example
48+
49+
- Input claims:
50+
- **phoneNumber**: +11234567890 (phoneNumber)
51+
- Output claims:
52+
- **phoneNumberString**: +11234567890 (string)
53+
54+
2555
## ConvertStringToPhoneNumberClaim
2656

27-
This claim validates the format of the phone number. If it is in a valid format, change it to a standard format used by Azure AD B2C. If the provided phone number is not in a valid format, an error message is returned.
57+
This claim transformation validates the format of the phone number. If it is in a valid format, change it to a standard format used by Azure AD B2C. If the provided phone number is not in a valid format, an error message is returned.
2858

2959
| Item | TransformationClaimType | Data Type | Notes |
3060
| ---- | ----------------------- | --------- | ----- |
@@ -64,10 +94,10 @@ The self-asserted technical profile that calls the validation technical profile
6494
### Example 1
6595

6696
- Input claims:
67-
- **phoneNumberString**: 045 456-7890
97+
- **phoneNumberString**: 033 456-7890
6898
- **country**: DK
6999
- Output claims:
70-
- **outputClaim**: +450546148120
100+
- **outputClaim**: +450334567890
71101

72102
### Example 2
73103

@@ -76,6 +106,7 @@ The self-asserted technical profile that calls the validation technical profile
76106
- Output claims:
77107
- **outputClaim**: +11234567890
78108

109+
79110
## GetNationalNumberAndCountryCodeFromPhoneNumberString
80111

81112
This extracts the country code and the national number from the input claim, and optionally throws an exception if the supplied phone number is not valid.

0 commit comments

Comments
 (0)