Share via

Issue with the NodeJs console tutorial

Nicolas 41 Reputation points
2022-03-07T14:40:56.56+00:00

Hi everyone,

I followed the tutorial in order to call the Graph API with a nodejs console: https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-nodejs-console

I successfully get all the users in my entity with the example command "getUsers".
But when I personalize the command in order to get a user Schedule for instance, I have a 403 error (authentication error) and no additional information in the logs.

Otherwise on Postman I can get everything i want. So all the API permissions are granted by the administrator for the App.

Do you have any suggestions?

Thanks in advance.

Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

Vicky Kumar (Mindtree Consulting PVT LTD) 1,161 Reputation points Microsoft Employee
2022-03-08T09:42:13.637+00:00

Hi NicoInnov ,

Could you please check the token in https://jwt.ms/ ,if you have required permission or not - https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http

This is quite weird that you are able to see the expected data in Postman where as in graph it won't , for this you can check both the token from graph and postman , and compare the differences

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Nicolas 41 Reputation points
    2022-03-08T13:51:39.407+00:00

    Hi,
    Thank you for your answer.

    As you said it is weird but it is working when I granted "Application" permissions instead "Delegated" permissions.

    It is solved!

    Was this answer helpful?


Your answer

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