0
votes

I have a specific condition where I need to verify the user for the registration. The user enters the city and this must match with one of the allowed city name from my back-end. The user should only be able to register only if the city name matches and exist in the back-end. So, the condition is, how can I approach this flow using the Azure AD B2C user registration using custom policies. Is there any better approach to do this?

The user should only be able to register in the Azure AD B2C only if the city name matches with the one being contained back-end. If the name doesn't matches, they should be shown error and registration process must be halted.

1

1 Answers

0
votes

In the self asserted technical profile where you collect the email, and is submitted to B2C, add a validation technical profile. These are executed when the user submits the form. This should call a technical profile which calls your REST API. It will send the email and city to your API. Your API should respond with a HTTP 200, which will just allow the process to continue, or otherwise send a non 200 response with an error code.

https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-rest-api-validation-custom