Managing external identities to enable secure access for partners, customers, and other non-employees
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello, I am trying to update user using the graph api b2c. I've already given an consent all the privileges, but still got the message:
"One or more errors occurred. (Code: Authorization_RequestDenied
Message: Insufficient privileges to complete the operation. "
Any ideas?
var scopes = new[] { "https://graph.microsoft.com/.default"};
var clientSecretCredential = new ClientSecretCredential(config.TenantId, config.AppId, config.ClientSecret);
var graphClient = new GraphServiceClient(clientSecretCredential, scopes);
var password = Helpers.PasswordHelper.GenerateNewPassword(4, 8, 4);
var user = new User
{
Id = "b142f0f0-fb74-4755-a525-b1bfede56d81",
PasswordProfile = new PasswordProfile
{
Password = password,
ForceChangePasswordNextSignIn = false
},
PasswordPolicies = "DisablePasswordExpiration"
};
await graphClient
.Users["b142f0f0-fb74-4755-a525-b1bfede56d81"]
.Request()
.UpdateAsync(user);
Managing external identities to enable secure access for partners, customers, and other non-employees
An API that connects multiple Microsoft services, enabling data access and automation across platforms