简体   繁体   中英

Active Directory Graph Client add gallery app

I am using The Microsoft.Azure.ActiveDirectory.GraphClient package to try and add an existing app from the Azure Gallery to my AD applications.

This is the code I'm using:

ServicePrincipal p = new ServicePrincipal();

p.AppId = "08c6d8e8-a6d7-463a-9b6e-fe8a928a31a3";

But I'm getting the following error: "Insufficient privileges to complete the operation."

Any ideas?

Thanks..

Currently the only way you can add service principals to the tenant is by configuring your app (that is writing to the directory) to request the "Access directory as the signed-in user" delegated permission. Only admins can consent to this permission. You can find more details on permissions here: https://msdn.microsoft.com/en-us/Library/Azure/Ad/Graph/api/graph-api-permission-scopes . Also the user will need to be an admin to use your app (when it attempts to write to the directory).

Hope this helps,

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