简体   繁体   English

Azure AD B2C - 如何以编程方式创建消费者用户?

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

Which API should I call on Azure B2C to create a CONSUMER user?我应该在 Azure B2C 上调用哪个 API 来创建消费者用户? 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/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 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 -本地帐户身份

Do not use forceChangePassword=true unless using User Flows V1 (deprecated).除非使用 User Flows V1(已弃用),否则请勿使用 forceChangePassword=true。 You must always set password expiry policy to never.您必须始终将密码过期策略设置为从不。

Use this Microsoft Graph Api .使用此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"
  }
}

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

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