Hello,
I am trying to use the {Context:DateTimeInUtc} claims resolver in an Azure AD B2C Custom Policy and I am getting the following error message:
There was an error serializing the object of type Microsoft.Cpim.Data.TrustFrameworkPolicy. The string '{Context:BuildNumber}' is not a valid AllXsd value
According to the documentation it indicates that ClaimsResolvers are allowed to be used in Azure Active Directory Technical Profiles with either InputClaims or OutputClaims as long as the following settings are true:
IncludeClaimResolvingInClaimsHandling is set to true.
AlwaysUseDefaultValue is set to true.
<TechnicalProfile Id="AAD-Write-ByObjectId-Password">
<Metadata>
<Item Key="Operation">Write</Item>
<Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="objectId" Required="true" />
<InputClaim ClaimTypeReferenceId="extension_lastPasswordChangeDateTime" DefaultValue="{Context:DateTimeInUtc}" AlwaysUseDefaultValue="true" />
</InputClaims>
<PersistedClaims>
<!-- Required claims -->
<PersistedClaim ClaimTypeReferenceId="objectId" />
<PersistedClaim ClaimTypeReferenceId="Password-Validated-Password" PartnerClaimType="password" />
<PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration, DisableStrongPassword" />
<PersistedClaim ClaimTypeReferenceId="extension_isRegistered" DefaultValue="true" AlwaysUseDefaultValue="true" />
<PersistedClaim ClaimTypeReferenceId="extension_lastPasswordChangeDateTime" />
</PersistedClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="objectId" />
</OutputClaims>
<IncludeTechnicalProfile ReferenceId="AAD-Common" />
<UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>
For the sake of further testing, I have tried other Context Claims Resolvers and was able to duplicate the same output.