ResourceNotFound with MSAL

%3CLINGO-SUB%20id%3D%22lingo-sub-2581460%22%20slang%3D%22en-US%22%3EResourceNotFound%20with%20MSAL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2581460%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20working%20on%20adapting%20a%20simple%20mail%20client%20to%20handle%20Azure%20accounts%20with%20OAuth2.%3C%2FP%3E%3CP%3EFor%20now%20I'm%20playing%20with%20the%20MSAL4J%20sample%20app.%20I%20modified%20it%20to%20fetch%20the%20messages%20in%20my%20personal%20mailbox%20(%40live.fr)%2C%20so%20basically%20I've%20replaced%20the%20scope%20%22User.Read%22%20with%26nbsp%3B%22Mail.Read%22%2C%20and%20changed%20the%20query%20URL%20to%20%3CA%20href%3D%22https%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fmessages%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgraph.microsoft.com%2Fv1.0%2Fme%2Fmessages%3C%2FA%3E.%3C%2FP%3E%3CP%3EI%20get%20the%20following%20error%20response%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%22error%22%3A%7B%22code%22%3A%22ResourceNotFound%22%2C%22message%22%3A%22Resource%20could%20not%20be%20discovered.%22%2C%22innerError%22%3A%7B%22date%22%3A%222021-07-23T18%3A39%3A07%22%2C%22request-id%22%3A%2220d75a0c-fc4b-4e76-b156-96afa1c8132d%22%2C%22client-request-id%22%3A%2220d75a0c-fc4b-4e76-b156-96afa1c8132d%22%7D%7D%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%20the%20app%20has%20the%20necessary%20permissions%2C%20everything%20related%20to%20mails%20has%20been%20added%2C%20with%20admin%20consent%20%3D%20no%20and%20status%20%3D%20granted%20for%20the%20directory.%3C%2FP%3E%3CP%3EIn%20Graph%20Explorer%20the%20query%20works%20fine%20after%20consenting%20to%20the%20required%20permissions.%3C%2FP%3E%3CP%3EWhat%20am%20I%20missing%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Regular Visitor

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