Microsoft.Graph todo tasks

Murphy Xu 1 Reputation point
2021-01-21T03:51:11.62+00:00

i have register a application and the permissions are already set

58930-image.png

but when I get the todo tasks list, an error occured

the error message are as follow

Code: notAllowed
Message: Access is denied to the requested resource. The user might not have enough permission.
Inner error:
Code: ErrorAccessDenied
Message: Access is denied. Check credentials and try again.

what can i do

new GraphServiceClient(  
                new DelegateAuthenticationProvider(  
                    async (requestMessage) =>  
                    {  
                          
                        requestMessage.Headers.Authorization =  
                            new AuthenticationHeaderValue("Bearer", 'access_token get by username and password');  
                    }));  
 
  var events = await GetAuthenticatedClient().Me.Todo.Lists.Request().GetAsync();  
  IEnumerable<TodoTaskList> todoLists =   events.CurrentPage;  
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,570 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-01-21T13:26:13.783+00:00
    • Try repro the issue outside of your code, by making the same call in Microsoft Graph explorer and the above user
    • See whether you provided the necessary permissions for the user
    • Validate the token using https://jwt.ms and see it contains scopes/permissions rightly set for the user or not.
    0 comments No comments

  2. Murphy Xu 1 Reputation point
    2021-01-22T02:24:54.92+00:00

    59441-image.png

    59357-image.png

    0 comments No comments

  3. Deva-MSFT 2,256 Reputation points Microsoft Employee
    2021-02-04T18:34:51.193+00:00

    I see that you're trying to create new tasks in TODO workload using Application permission. Correct me if i am wrong. Please note that application permission is not supported for creating new tasks in TODO workload.

    0 comments No comments