简体   繁体   中英

Microsoft.Graph library required permission for application AddPassword and RemovePassword

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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