0
votes

Check user exists in AD B2C(using custom policy) if user exists show login option else(if user doesnt exists) show registration form

enter image description here

I tried with below policy but couldnt make it work https://github.com/azure-ad-b2c/samples/tree/master/policies/split-email-verification-and-signup

<ClaimsTransformation Id="AssertObjectIdObjectIdNotFoundAreEqual" TransformationMethod="CompareClaims">
            <InputClaims>
                <InputClaim ClaimTypeReferenceId="objectId" TransformationClaimType="inputClaim1" />
                <InputClaim ClaimTypeReferenceId="objectIdNotFound" TransformationClaimType="inputClaim2" />
            </InputClaims>
            <InputParameters>
                <InputParameter Id="operator" DataType="string" Value="NOT EQUAL" />
                <InputParameter Id="ignoreCase" DataType="string" Value="true" />
                <!-- <InputParameter Id="stringComparison" DataType="string" Value="ordinalIgnoreCase" /> -->
            </InputParameters>
            <OutputClaims>
                <OutputClaim ClaimTypeReferenceId="EmailExists" TransformationClaimType="outputClaim" />
            </OutputClaims>
        </ClaimsTransformation>

I'm trying to compare objectid, so i can have EmailExists claim but it doesnt give true/false based on objectid exists

Any one has idea how to do it, please help

1
What error do you have currently? "couldnt make it work " doesn't make sense.Allen Wu
@AllenWu I've attached the code I'm trying to compare objectid, so i can have EmailExists claim but it doesnt give true/false based on objectidRamesh

1 Answers

0
votes

The step “known email” -> the logic should be “does ObjectId Exist”. In your orchestration steps, read the directory using the given email after code verification step. In the AAD technical profile, use the metadata config to not throw an error if the user is not found.

Now you will either have or not have an objectId. The subsequent orchestration step should use a precondition using ClaimExists logic against objectId to drive the subsequent logic.

You could even use two subjourneys pivoting off whether objectId exists.