How to access resource's calendar outside my organization through EWS?

Moin Uddin Kashif 1 Reputation point
2020-09-21T13:32:49.333+00:00

Hello,
I have an Android application which was using Basic authentication for Microsoft 365 (username, password and URL=https://outlook.office365.com/ews/Exchange.asmx). I was using EWS to get the calendar of the signed in user to display the events from his calendar.
With new changes in the MS authentication I have to use OAuth for the authentication. I have registered my app in Azure portal and got the tenant and client IDs.
I am able to authenticate the user in my organization but how can I authenticate the user (which is not in my organization) so he can display his calendar in my app.

For example
My organization : scheduledisplay.com
Signed user : user1@scheduledisplay.com
Customer’s resource: resource1@itservices .com (which they want to use in our app to display the calendar’s events)

For the authentication I am using the information from Azure portal for my registered app
Client ID: 5666989b-xxxxxx-xxxxxx-xxxx-xxxxxxxxx
Tenant ID: scheduledisplay.com
User: user1@scheduledisplay.com
Password: xxxxxxxxx
This works fine if I use "user1@scheduledisplay.com" but if I use "user1@itservices .com" then it gave me an error "AADSTS65001: The user or administrator has not consented to use the application with ID '5666989b-xxxxxx-xxxxxx-xxxx-xxxxxxxxx' named 'Schedule display'. Send an interactive authorization request for this user and resource."

I have enabled the Delegate permission in the API permissions in Azure, but it didn't solve the problem.
What should I do?

Thanks

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,447 questions
{count} votes