To address the Microsoft's Deprecation of Basic auth for EWS Applications, we are trying to implement modern auth(OAuth) using Microsoft's Graph API in Java :
App only ClientSecretCredential process of Microsoft Graph API following its documentation, we have been able to successfully get the Access token (with the credentials we recieved from Azure AD app registration), and to check if we can access the Outlook inbox or not , we were trying to list the Inbox emails (used inbox's id which our team owns to test if the emails are getting listed or not) :
return _appClient.users("*********@***.com")
.mailFolders("inbox")
.messages()
.buildRequest()
.select("from,isRead,receivedDateTime,subject")
.top(25)
.orderBy("receivedDateTime DESC")
.get();
and while checking in Postman with client credentials and token we get Access denied
while Azure AD app registration we did mention the required permissions .
Any inputs will be helpful in resolving the issue.