Share via

Problem with Azure Update User API permissions for Graph

propup 1 Reputation point
2022-09-12T13:49:22.577+00:00

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);  
  
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. propup 1 Reputation point
    2022-09-13T00:15:56.413+00:00

    240292-untitled.png

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.