Ayesh Nipun
Ayesh Nipun

Reputation: 614

How to write an Azure B2C custom policy that triggers when a new user is added

I have a project, implemented using react js and Azure B2C. For sign-in and password reset, I used azure built-in user policies. What I want is when I add a user with the 'create Zure Ad B2C user' option, I want the user to get an email (An invite). As I know B2C doesn't have this function yet. I found out that this might be solved by a custom policy. But I don't know how. Can anyone help me with this? Thanks in advance.

Upvotes: 0

Views: 445

Answers (1)

Jas Suri - MSFT
Jas Suri - MSFT

Reputation: 11335

This type of process would not be handled by the B2C flows. A user creation task cannot be tied to an email being sent out from our service. You would rather follow something like this:
https://github.com/azure-ad-b2c/samples/tree/master/policies/invite

You would create the user via portal or Graph API. Then generate a link and send it via a mail provider to the users email containing the link to compete the registration, eg providing their password.

Upvotes: 2

Related Questions