You can use Claims Transformations such as AssertStringClaimsAreEqual or AssertBooleanClaimIsEqualToValue to raise a custom error and stop the user journey or just Preconditions so that desired steps are skipped or not.
Stop user journey and display message in Azure AD B2C
I have a custom policy that sets up authentication from other Azure AD tenants. After the user successfully logs in with AAD, I enrich the claims with a REST api call. I wanted to follow that with a check on some of the attributes returned from the REST API. And depending on the result of that check, either halt further progress and just display a message or go on with the user journey to completion. So far, I have tried adding an orchestration step that uses a self asserted technical profile that uses another profile as a technical profile that in turn uses claims transformation to determine the result of the check I do. Something like what is shown here: https://github.com/azure-ad-b2c/samples/blob/master/policies/disable-social-account-from-logon/TrustFrameworkExtensions.xml. However, even if that check fails, journey runs to completion and token is issued to the relying party. What I was expecting was, journey will be halted and a message will be displayed. Unfortunately not. Any insight please?
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
2 answers
Sort by: Most helpful
-
Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
2020-08-20T15:29:50.387+00:00 -
code-surgeon 151 Reputation points
2020-08-21T10:38:14.19+00:00 Figured out what I was missing.
The self asserted TP needed to have at least one text element (UserInputType). I added one of type paragraph. And it is working as expected now.