Yes OAuth will work fine with EWS (and is now required as basic authentication is being depreciated) see https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth and https://github.com/AzureAD/microsoft-authentication-library-for-java
oAuth2.0 authentication using EWS for Exchnage/Ofiice 365
Sanjeev Kumar
1
Reputation point
We want to use oAuth authentication and operation for Office365 and we are using Java to achieve this, EWS can be used here or need to go through Graph only.