App permission for deleting Planner Task from Power Automate

GUIOT Nicolas 20 Reputation points
2023-12-19T11:23:16.1866667+00:00

Hello,

I'm trying to create a Power Automate flow to delete Planner tasks from a list, by calling an HTTP request (method: DELETE). My issue is about the access-token to give to the call.

I registered an App in my Azure Portal, and granted some permissions to Microsoft Graph, in particular Tasks.ReadWrite.

But I get the following error :

You do not have the required permissions to access this item, or the item may not exist.

What's wrong?

Thanks

Kr,

Nicolas

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Graph
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2024-01-02T08:19:44.3766667+00:00

    Hi @GUIOT Nicolas

    This is not an id token, but an app-only token. Delegated permissions you grant to the calling app are not synced into the app-only token.

    You should request a delegated access token using the delegated authentication flow. Don't forget to grant user consent for your permissions when logging in the user.

    https://login.microsoftonline.com/{tenant id}/oauth2/v2.0/authorize?
    client_id={client id}
    &response_type=code
    &redirect_uri={redirect url}
    &response_mode=query
    &scope=Tasks.ReadWrite
    &state=12345
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

Your answer

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