ResourceNotFound with MSAL

Copper Contributor

I'm working on adapting a simple mail client to handle Azure accounts with OAuth2.

For now I'm playing with the MSAL4J sample app. I modified it to fetch the messages in my personal mailbox (@live.fr), so basically I've replaced the scope "User.Read" with "Mail.Read", and changed the query URL to https://graph.microsoft.com/v1.0/me/messages.

I get the following error response:

 

 

{"error":{"code":"ResourceNotFound","message":"Resource could not be discovered.","innerError":{"date":"2021-07-23T18:39:07","request-id":"20d75a0c-fc4b-4e76-b156-96afa1c8132d","client-request-id":"20d75a0c-fc4b-4e76-b156-96afa1c8132d"}}}

 

 

I think the app has the necessary permissions, everything related to mails has been added, with admin consent = no and status = granted for the directory.

In Graph Explorer the query works fine after consenting to the required permissions.

What am I missing?

 

Thank you in advance.

0 Replies