Create "B2C User" with Microsoft Graph API

Roei 41 Reputation points

We are trying to use B2C for our customer user login flow, but we have decided to use the ROPC flow for the basic login flow. As a result, we have to implement the user creation during registration ourselves.

We have been creating users with the Microsoft Graph API but it seems that we can only create users with the email domain "" instead of being able to make a "B2C User" which can have an email with any domain.

Is there a way to create "B2C Users" with the Microsoft graph API? (254388-screen-shot-2022-10-26-at-111558-am.pngSee screenshot showing the "B2C User" template from the "create user" menu in the Azure portal)

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
32,914 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 39,511 Reputation points

    Hey Roi,

    Please check a similar thread and there is a code shared by the MSFT and also by the creator of the question and this should give you a good start - cannot-create-a-azure-b2c-user-via-ms-graph-api.html

    Hope this helps.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. CarlZhao-MSFT 32,276 Reputation points

    Hi @Roei

    Make sure you're using Azure AD-specific ROPC flow to get tokens.

    Then call the /users endpoint to create a B2C user with social and local account identities:

    Content-type: application/json  
      "displayName": "John Smith",  
      "identities": [  
          "signInType": "userName",  
          "issuer": "",  
          "issuerAssignedId": "johnsmith"  
          "signInType": "emailAddress",  
          "issuer": "",  
          "issuerAssignedId": ""  
          "signInType": "federated",  
          "issuer": "",  
          "issuerAssignedId": "5eecb0cd"  
      "passwordProfile" : {  
        "password": "password-value",  
        "forceChangePasswordNextSignIn": false  
      "passwordPolicies": "DisablePasswordExpiration"  

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.