Hello @Backend Scale
Thanks for reaching out!
Possible reasons you're getting this error message:
- The above error can occur because of an invalid/expired Client Secret being used. This can be fixed by generating a new Client Secret for the Azure AD application.
- Incorrect permissions- Refer this for more details.
- Not using correct token to call O365 Management API with required permissions.
Note: Make sure you've requested (and granted consent for) all the appropriate API permisions.
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".