Home > Back-end >  Microsoft.Graph library required permission for application AddPassword and RemovePassword
Microsoft.Graph library required permission for application AddPassword and RemovePassword

Time:11-28

I am trying to add and remove passwords with the Microsoft.graph library.

graphServiceClient.Applications[app.Id]
.AddPassword(pwc)
.Request()
.PostAsync();

And

graphServiceClient.Applications[app.Id].RemovePassword(oldPassword.KeyId.Value).Request().PostAsync();

But I am getting the following error:

Microsoft.Graph.ServiceException: 'Code: Authorization_RequestDenied Message: Insufficient privileges to complete the operation.

Which api permission do I need for this? I already have Application.ReadWrite.All. But still getting this error.

CodePudding user response:

For other people who run into the same issue, Application.ReadWrite.All was the permission I needed. I tried this permission before, but didn't set it as application type.

  • Related