Hi, I need to pass an input claim with a localized DefaultValue
within a RESTful provider technical profile (not within a Self-Asserted technical profile) of a custom policy but as soon as I add the reference to the transformation method GetLocalizedStringsTransformation
within InputClaimsTransformations
my application crashes (ADB2C: An exception has occurred).
The localized input claim must be within the RESTful provider technical profile.
Custom Claim definition:
<ClaimsSchema>
<ClaimType Id="localizedResult">
<DataType>string</DataType>
<UserInputType>Readonly</UserInputType>
</ClaimType>
</ClaimsSchema>
Localization:
<Localization Enabled="true">
<SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
<SupportedLanguage>en</SupportedLanguage>
<SupportedLanguage>es</SupportedLanguage>
</SupportedLanguages>
<LocalizedResources Id="api.selfasserted.en">
<LocalizedStrings>
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="localized_string">English Value</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
<LocalizedResources Id="api.selfasserted.es">
<LocalizedStrings>
<LocalizedString ElementType="GetLocalizedStringsTransformationClaimType" StringId="localized_string">Valor en Espanol</LocalizedString>
</LocalizedStrings>
</LocalizedResources>
</Localization>
Claim Transformation:
<ClaimsTransformations>
<ClaimsTransformation Id="GetLocalizedStringsForCustomClaim" TransformationMethod="GetLocalizedStringsTransformation">
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="localizedResult" TransformationClaimType="localized_string" />
</OutputClaims>
</ClaimsTransformation>
</ClaimsTransformations>
RESTful provider technical profile:
<TechnicalProfile Id="REST-Technical-Profile">
<DisplayName>My App</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
<Metadata>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
<Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
<Item Key="ServiceUrl">https://my-app.test/api/endpoint</Item>
<Item Key="SendClaimsIn">Body</Item>
<Item Key="AuthenticationType">Bearer</Item>
</Metadata>
<InputClaimsTransformations>
<InputClaimsTransformation ReferenceId="GetLocalizedStringsForCustomClaim" />
</InputClaimsTransformations>
<InputClaims>
<InputClaim ClaimTypeReferenceId="myCustomClaim" DefaultValue="{Claim:localizedResult}" AlwaysUseDefaultValue="true" />
</InputClaims>
</TechnicalProfile>
I tried with the method CreateStringClaim
and it created a transformed value as expected but that method doesn't allow me to map translations based on language and custom translation collection.