简体   繁体   English

在 Azure AD B2C 中使用自定义策略在注册期间验证和验证用户输入数据

[英]Validate and Verify the user input data during registration using custom policy in Azure AD B2C

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.因此,条件是,我如何通过使用自定义策略的 Azure AD B2C 用户注册来处理此流程。 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.只有当城市名称与后端包含的城市名称匹配时,用户才能在 Azure AD B2C 中注册。 If the name doesn't matches, they should be shown error and registration process must be halted.如果名称不匹配,则应显示错误并且必须停止注册过程。

In the self asserted technical profile where you collect the email, and is submitted to B2C, add a validation technical profile.在您收集电子邮件并提交给 B2C 的自称技术配置文件中,添加验证技术配置文件。 These are executed when the user submits the form.这些在用户提交表单时执行。 This should call a technical profile which calls your REST API.这应该调用调用您的 REST API 的技术配置文件。 It will send the email and city to your API.它会将电子邮件和城市发送到您的 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.您的 API 应以 HTTP 200 响应,这将仅允许进程继续,否则发送带有错误代码的非 200 响应。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM