[英]Azure AD B2C Create User with the Graph API error
我按照本指南設置我的 azure 應用程序和此代碼以在我的B2C
用戶 AD 中創建用戶:我在.AddAsync(user)
上得到一個System.NullReferenceException
。
// Create the user account in the directory
var u = graphClient.Users;
var v = u.Request();
var w = await v.AddAsync(user); // --> NullReferenceException: v is not null
在還測試了以下內容:
var user = new User
{
AccountEnabled = true,
DisplayName = "Adele Vance",
MailNickname = "AdeleV",
UserPrincipalName = "AdeleV@contoso.onmicrosoft.com",
PasswordProfile = new PasswordProfile
{
ForceChangePasswordNextSignIn = true,
Password = "xWwvJ]6NMw+bWH-d"
},
};
// Create the user account in the directory
var u = graphClient.Users;
var v = u.Request();
var w = await v.AddAsync(user); //--> same error
問題是測試版 Nuget package Microsoft.Graph.Beta Version="0.12.0-preview"
。 我切換到新的Microsoft.Graph Version="3.27.0" and Microsoft.Graph.Core Version="1.24.0"
並更新了所有其他的。
我打開了一個拉取請求
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.