none
Azure AAD and Graph API: Insufficient privileges to complete the operation while assigning Licenses RRS feed

  • Question

  • I am trying to assign license to user using graph API but receiving "insufficient privileges to complete the operation. graph api" error even I have "Directory.ReadWrite.All" permission in Azure AD app. Any quick advise would be really appreciated.
    Wednesday, September 25, 2019 1:23 PM

All replies

  • Hi Ishaque A.R Adoni,

    Sorry for delay in reply.

    For delegated permission , you can use User.ReadWrite.All or Directory.ReadWrite.All permission with :

        POST /users/{id | userPrincipalName}/assignLicense

    In Azure portal . Choose `Add a permission`, and under Microsoft APIs, select `Microsoft Graph`, and then select `Delegated permissions` and add the permissions you need .

    The both permissions(User.ReadWrite.All / Directory.ReadWrite.All) need admin consent . Admin of your tenant can clike the `Grant admin consent for tenant` button for admin consent.

    After acquiring Microsoft Graph API's access token . You can decode token using online tool like jwt.io to check whether specific permission is included in `scopes` claim .

    Hope all above could help you and any feedback will be expected.

    Best Regards,

    Tianyu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, September 26, 2019 8:04 AM
  • Hi Tianyu,

    Thanks for your reply. I have already performed all the configurations requested by you. However the only thing which left was for verifying the scope using jwt.io that is also done I am getting scope as "scp": "Directory.ReadWrite.All User.Read profile openid " . Could you pleasele me know whether the scope is correctly configured or any other alteration needed on Azure.

    Thanks,

    Ishaque

    Thursday, September 26, 2019 3:14 PM
  • Hi Ishaque,

    Thank you for the feedback.

    For your requirement, which API do you use? Could you please share us with your API request, so that we could check and provide you with more suggestions.

    Looking forward to hearing from you.

    Best Regards,

    Tianyu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, September 27, 2019 8:15 AM