I have been struggling with this problem for 2 days.
I am currently trying to build a web application which is able to revoke the MS Graph Api to fetch the current user's email messages.
Firstly I have register an AD and a application within it, and follow the instructions setup the permissions.
Now I have achieved obtaining the access token by utilising the ADAL.js library. The access token is in the jwt format, and when I check it via jwt.ms, it seems like have all the permissions I need:
"scp": "Mail.Read Mail.ReadWrite profile User.Read User.Read.All User.ReadBasic.All User.ReadWrite User.ReadWrite.All"
And then when I tried to used the access token to call the graph api:
GET "https://graph.microsoft.com/v1.0/me"
It worked and return my profile details.
But when I used the token to call: GET "https://graph.microsoft.com/v1.0/me/mailFolders/"
It returns 401 Unauthorised error:
code: "OrganizationFromTenantGuidNotFound"
message: "The tenant for tenant guid <my tenant id> does not exist.
I tried using both the JavaScript Fetch and also PostMan to try the api, same error returned.
Can anybody give a hand on this, I will very much appreciate it!
Thank you