I’m trying to enable combined MFA options for Azure B2C via custom policies but I’m receiving error while trying to do so. I’ve used https://github.com/azure-ad-b2c/samples/blob/master/policies/mfa-email-or-phone/policy/SignUpOrSignin_PhoneOrEmailMFA.xml as my starting point.
I’m getting error
Profile 'Jwt Issuer' in policy 'B2C_1A_signup_signin_saml' in tenant 'in group devb2c.xxxx.com' does not contain the required cryptographic key 'SamlAssertionSigning'
Please find below my custom policies for B2C_1A_TRUSTFRAMEWORKEXTENSIONS.xml
<OrchestrationStep Order="7" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="true">
<Value>extension_mfaByPhoneOrEmail</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="SelfAsserted-Select-MFA-Method" TechnicalProfileReferenceId="SelfAsserted-Select-MFA-Method" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="8" Type="InvokeSubJourney">
<Preconditions>
<!--Sample: If the preferred MFA method is not 'phone' skip this orchestration step-->
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>extension_mfaByPhoneOrEmail</Value>
<Value>totp</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<JourneyList>
<Candidate SubJourneyReferenceId="TotpFactor-Input" />
</JourneyList>
</OrchestrationStep>
<OrchestrationStep Order="9" Type="InvokeSubJourney">
<Preconditions>
<!--Sample: If the preferred MFA method is not 'phone' skip this orchestration step-->
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>extension_mfaByPhoneOrEmail</Value>
<Value>email</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="Email-Verify" TechnicalProfileReferenceId="EmailVerifyOnSignIn" />
</ClaimsExchanges>
</OrchestrationStep>
I’ve used https://github.com/azure-ad-b2c/samples/blob/master/policies/mfa-email-or-phone/policy/SignUpOrSignin_PhoneOrEmailMFA.xml as my starting point which is working as expected just tried to make changes on
<ClaimType Id="extension_mfaByPhoneOrEmail">
<DisplayName>Please select your preferred MFA method</DisplayName>
<DataType>string</DataType>
<UserInputType>RadioSingleSelect</UserInputType>
<Restriction>
<Enumeration Text="TOTP " Value="totp" SelectByDefault="true" />
<Enumeration Text="Email " Value="email" SelectByDefault="false" />
</Restriction>
</ClaimType>
I’m getting screen to enter my TOTP but in next step it fails with the message i.e. "Profile ‘Jwt Issuer’ in policy ‘B2C_1A_signup_signin_saml’ in tenant ‘in group devb2c.xxxx.com’ does not contain the required cryptographic key ‘SamlAssertionSigning’"
2
Answers
I was able to resolve this by adding
SamlAssertionSigning
andSamlAssertionSigning
in theJwtissuer
Technical profile.If you have a SAML authentication journey then you need to issue a SAML token at the end of it, not a JWT. The error is occurring because a JWT token issuer technical profile doesn’t have the necessary elements to issue a SAML token.
Don’t add the SAML keys to the JWT issuer technnical profile.
Instead, set up a SAML token issuer technical profile, and use that as the last step of your SAML
UserJourney
instead of theJwtIssuer
you already have:The Microsoft docs also have a full guide on how to set up B2C to support SAML service providers which may be helpful.