1

How to create invitation policy on Azure Active Directory and use it to send invitation to user for Business to Business (B2B) and Business to Consumer (B2C) in a web application? I use invitation API for Azure AD B2B to send invitation, but can't send when used in Azure AD B2C.

Saca
  • 10,355
  • 1
  • 34
  • 47
S. Deshmukh
  • 314
  • 4
  • 19

1 Answers1

3

At this time, Azure AD's B2B collaboration feature and Azure AD B2C are not compatible. Azure AD B2C does not have any built-in invitation mechanism as it is tailored for self-service registration via the signup and signup/signin policies. There is an existing feedback request you can vote for: AADB2C: Send email invitation for new user to sign up.

You can implement this yourself by creating your own invitation UI. This UI would call the Azure AD graph to create the users.

You can then either:

  • Use the password reset policy as their first time experience since that sends an email to the user with a code. Note that you have very limited control over the look & contents of this email.
  • OR, create your own "redeeming" or "activation" mechanism, for example:
    1. Ensure you set accountEnabled to false when creating the user.
    2. Create an activation code/link and email that to the user (using SendGrid for example). You'll need to be able to associate that code/link to the user somewhere/somehow.
    3. Once the user navigates to the link or uses the code, update the user via the Graph again to set its accountEnabled flag to true.

Note: this will only work for local users and not for social users.

spottedmahn
  • 14,823
  • 13
  • 108
  • 178
Saca
  • 10,355
  • 1
  • 34
  • 47
  • 2
    Another option is the how WingTip Games demo did it, [see here](https://stackoverflow.com/questions/32707131/azure-ad-b2c-send-invitation-email-to-new-user#answer-46350962). – spottedmahn Nov 06 '17 at 15:33
  • 1
    A detailed description of how it is done with the Wingtip Games demo is [here](https://stackoverflow.com/questions/46984166/sign-up-policy-set-user-attributes-through-code/46996797#46996797). – Chris Padgett Nov 07 '17 at 09:24