B2C_1A_MANAGE_SECURITY. You can use any policy ID.
Prerequisites
Complete the MFA integration guide first. This policy uses the same base policies and the sameB2C_1A_AuthsignalSecret policy key.
Try a live demo!
Sequence
Code example
The full policy is in each example repository:- ManageSecurity.xml in the MFA example
- ManageSecurity_Passwordless.xml in the passwordless example
- ManageSecurity_Passkey.xml in the passkey example
Step by step guide
Step 1: Create a manage security action in Authsignal
In the Authsignal Portal, create an action for managing authenticators, for examplemanageSecurity. In the action’s configuration, add these steps to the flow:
- A Verification step. Allow every method that your users can enroll, for example Email OTP, Passkey and SMS OTP.
- A Manage methods step. Select the methods that users can manage.
Step 2: Create the policy file
Create a policy file, for exampleManageSecurity.xml. Set its base policy to the extensions policy from the MFA guide.
Step 3: Declare the claims
Add these claims to<BuildingBlocks><ClaimsSchema>.
Step 4: Add the claims transformations
Add these claims transformations to<BuildingBlocks><ClaimsTransformations>. Replace the INSERT_AUTHSIGNAL_ACTION placeholder with the action code from step 1.
The first transformation builds the init auth request body. Its custom.correlationId field stores the B2C correlation ID on the Authsignal action. The other two check the user ID and the action state in the token from Authsignal.
Step 5: Add the technical profiles
Add these technical profiles to a<ClaimsProvider> in <ClaimsProviders>. Replace the AUTHSIGNAL_CONNECT_HOSTNAME and INSERT_AUTHSIGNAL_TENANT_ID placeholders with the values from the MFA guide. The OIDC documentation lists the hostnames.
With SM-Noop session management, Azure AD B2C runs the Authsignal steps every time.
Step 6: Add the user journey
Add this user journey to<UserJourneys>.
In step 1, use the sign-in technical profile from your sign-in journey. The passwordless example uses SelfAsserted-LocalAccountSignin-Email_Passwordless. Azure AD B2C skips this step when the user has a B2C session.
Step 7: Add the relying party
Add the relying party after<UserJourneys>. It puts the action state and the correlation ID in the ID token.
If your sign-in page uses JavaScript, for example for passkey
autofill, add
<UserJourneyBehaviors><ScriptExecution>Allow</ScriptExecution></UserJourneyBehaviors> after
<DefaultUserJourney>. Step 1 shows that page when the user has no B2C session.Step 8: Upload the policy and add the redirect URI
- Upload the policy to your Azure AD B2C tenant.
- In your app registration, add the redirect URI for the manage security response.
Step 9: Add a manage security button to your app
When a signed-in user clicks the button, send an OpenID Connect authorization request for your manage security policy. Pass the user’s email address inlogin_hint.
pages/api/auth/[...nextauth].ts.
Step 10: Read the result
The ID token from the manage security policy contains these claims:
If the flow fails or the user IDs don’t match, the policy shows the error page and returns no token.
This ID token has no name or email address. Add the result to the session from sign-in. Don’t replace that session.

