Closed janh-kramer closed 3 years ago
Can you post the code that you're using to fetch the token? Authentication issues aren't something I can usually help you with, but I'd suggest trying to get the token using the oauth authentication example
Thank you for your help. It was a configuration error on server side, now it is working!
@janh-kramer , can you tell how did you solved your problem? What's the problem on the server side?
@paladini, sorry for the late reply. Actually I don’t know, because I have no access to server side, and did not solve this problem myself. Keep in mind that basic authentication is deprecated: https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online
Hi @janh-kramer , would be great if you could perhaps share the API permissions for the application in the MS Azure - Applications configuration?
The thing is, you don't actually need Azure permissions to access calendar items via ews. For me, setting up a service account with impersonation was enough. To access M365 via the Graph Api, you need Azure permissions.
I try to connect to a on premise ews-Service as a daemon app to fetch calendar items from different users/ressources. The App is registered in Azure AD and got the the application permission "full_access_as_app" and "Calendars.ReadWrite.All" I am able retrieve a token from https://login.microsoftonline.com/TENANT-ID/oauth2/v2.0/token which includes the following details:
With this token a make following call:
But I get 403 response from the server, breakpoint in NTLMSoapClient.php (215), function __doRequest
gives me:
I tried to hard code a
X-AnchorMailbox
header, as suggested here: https://docs.microsoft.com/en-us/archive/blogs/webdav_101/best-practices-ews-authentication-and-access-issues, Always set X-AnchorMailbox when using EWS Impersonation:But this changes nothing ..
What am I missing? With "full_access_as_app", and "Calendars.ReadWrite.All" a should have the permission to the calendar items. Thanks in advance for your help.