Skip to content

Commit f7e2001

Browse files
authored
Merge pull request #103284 from yoelhor/patch-1
Update string-transformations.md
2 parents 859a3bb + e710d47 commit f7e2001

File tree

1 file changed

+70
-2
lines changed

1 file changed

+70
-2
lines changed

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

Lines changed: 70 additions & 2 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/04/2020
12+
ms.date: 02/05/2020
1313
ms.author: marsma
1414
ms.subservice: B2C
1515
---
@@ -77,7 +77,7 @@ The self-asserted technical profile calls the validation **login-NonInteractive*
7777
- Input claims:
7878
- **inputClaim1**: [email protected]
7979
- **inputClaim2**: [email protected]
80-
- Input parameters:
80+
- Input parameters:
8181
- **stringComparison**: ordinalIgnoreCase
8282
- Result: Error thrown
8383

@@ -358,6 +358,74 @@ Use this claims transformation to format any string with two parameters, {0} and
358358
- Output claims:
359359
- **outputClaim**: Joe Fernando
360360

361+
## GetLocalizedStringsTransformation
362+
363+
Copies localized strings into claims.
364+
365+
| Item | TransformationClaimType | Data Type | Notes |
366+
| ---- | ----------------------- | --------- | ----- |
367+
| OutputClaim | The name of the localized string | string | List of claim types that is produced after this claims transformation has been invoked. |
368+
369+
To use the GetLocalizedStringsTransformation claims transformation:
370+
371+
1. Define a [localization string](localization.md) and associate it with a [self-asserted-technical-profile](self-asserted-technical-profile.md).
372+
1. The `ElementType` of the `LocalizedString` element must set to `GetLocalizedStringsTransformationClaimType`.
373+
1. The `StringId` is a unique identifier that you define, and use it later in your claims transformation.
374+
1. In the claims transformation specify the list of claims to be set with the localized string. The `ClaimTypeReferenceId` is a reference to a ClaimType already defined in the ClaimsSchema section in the policy. The `TransformationClaimType` is the name of the localized string as defined in the `StringId` of the `LocalizedString` element.
375+
1. In a [self-asserted technical profile](self-asserted-technical-profile.md), or a [display control](display-controls.md) input or output claims transformation, make a reference to your claims transformation.
376+
377+
The following example looks up the email subject, body, your code message, and the signature of the email, from localized strings. These claims later used by custom email verification template.
378+
379+
Define localized strings for English (default) and Spanish.
380+
381+
```XML
382+
<Localization Enabled="true">
383+
<SupportedLanguages DefaultLanguage="en" MergeBehavior="Append">
384+
<SupportedLanguage>en</SupportedLanguage>
385+
<SupportedLanguage>es</SupportedLanguage>
386+
</SupportedLanguages>
387+
388+
<LocalizedResources Id="api.localaccountsignup.en">
389+
<LocalizedStrings>
390+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_subject">Contoso account email verification code</LocalizedString>
391+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_message">Thanks for verifying your account!</LocalizedString>
392+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_code">Your code is</LocalizedString>
393+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_signature">Sincerely</LocalizedString>
394+
</LocalizedStrings>
395+
</LocalizedResources>
396+
<LocalizedResources Id="api.localaccountsignup.es">
397+
<LocalizedStrings>
398+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_subject">Código de verificación del correo electrónico de la cuenta de Contoso</LocalizedString>
399+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_message">Gracias por comprobar la cuenta de </LocalizedString>
400+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_code">Su código es</LocalizedString>
401+
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="email_signature">Atentamente</LocalizedString>
402+
</LocalizedStrings>
403+
</LocalizedResources>
404+
</Localization>
405+
```
406+
407+
The claims transformation sets the value of the claim type *subject* with the value of the string id *email_subject*.
408+
409+
```XML
410+
<ClaimsTransformation Id="GetLocalizedStringsForEmail" TransformationMethod="GetLocalizedStringsTransformation">
411+
<OutputClaims>
412+
<OutputClaim ClaimTypeReferenceId="subject" TransformationClaimType="email_subject" />
413+
<OutputClaim ClaimTypeReferenceId="message" TransformationClaimType="email_message" />
414+
<OutputClaim ClaimTypeReferenceId="codeIntro" TransformationClaimType="email_code" />
415+
<OutputClaim ClaimTypeReferenceId="signature" TransformationClaimType="email_signature" />
416+
</OutputClaims>
417+
</ClaimsTransformation>
418+
```
419+
420+
### Example
421+
422+
- Output claims:
423+
- **subject**: Contoso account email verification code
424+
- **message**: Thanks for verifying your account!
425+
- **codeIntro**: Your code is
426+
- **signature**: Sincerely
427+
428+
361429
## GetMappedValueFromLocalizedCollection
362430

363431
Looking up an item from a claim **Restriction** collection.

0 commit comments

Comments
 (0)