You can add a REST API call at any step in the user journey defined by a custom policy. For example, you can call a REST API:
In this case it seems to be Immediately after sign-in to Azure AD B2C app. You need to Add an orchestration step in the existing signup-signin policy user journey.
User journeys specify explicit paths through which a policy allows a relying party application to obtain the desired claims for a user. A user journey is represented as an orchestration sequence that must be followed through for a successful transaction. You can add or subtract orchestration steps. In this case, you will add a new orchestration step that is used to augment the information provided to the application after the user sign-up or sign-in via the REST API call.
- Open the base file of your policy. For example, SocialAndLocalAccounts/TrustFrameworkBase.xml.
- Search for the <UserJourneys> element. Copy the entire element, and then delete it.
- Open the extensions file of your policy. For example, SocialAndLocalAccounts/TrustFrameworkExtensions.xml.
- Paste the <UserJourneys> into the extensions file, after the close of the <ClaimsProviders> element.
- Locate the <UserJourney Id="SignUpOrSignIn">, and add the following orchestration step before the last one.
<OrchestrationStep Order="7" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="RESTGetProfile" TechnicalProfileReferenceId="REST-GetProfile" />
</ClaimsExchanges>
</OrchestrationStep>
- Refactor the last orchestration step by changing the Order to 8. Your final two orchestration steps should look like the following:
<OrchestrationStep Order="7" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="RESTGetProfile" TechnicalProfileReferenceId="REST-GetProfile" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="8" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
- Once done kindly follow Include a claim in the token. Please do let me know if you have any further queries by posting in the comments section. Thanks Akshay Kaushik Please "Accept the answer" (Yes), and share your feedback if the suggestion answers you’re your query. This will help us and others in the community as well.