简体   繁体   中英

Azure AD B2C - How to create a consumer user programatically?

Which API should I call on Azure B2C to create a CONSUMER user? Apparently this one is going away...

Here is the correct example and doc.

https://docs.microsoft.com/en-us/azure/active-directory-b2c/manage-user-accounts-graph-api

https://docs.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http#example-2-create-a-user-with-social-and-local-account-identities

Do not use forceChangePassword=true unless using User Flows V1 (deprecated). You must always set password expiry policy to never.

Use this Microsoft Graph Api .

here is a sample request

POST https://graph.microsoft.com/v1.0/users
Content-type: application/json

{
  "accountEnabled": true,
  "displayName": "displayName-value",
  "mailNickname": "mailNickname-value",
  "userPrincipalName": "upn-value@tenant-value.onmicrosoft.com",
  "passwordProfile" : {
    "forceChangePasswordNextSignIn": true,
    "password": "password-value"
  }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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