Reputation: 425
Currently I have a calendar synchronization tool between a custom calendar system (in a business app solution) and Exchange servers. I am using the Microsoft.Exchange.WebServices Nuget package. According to this Microsoft page Microsoft is going to shut down EWS (or at least Basic Authentication which the Nuget Package uses) on Office 365. What's the best way to migrate my application to the new API, I really want to avoid to start from scratch with a new application. Is there any update to the nuget package or anything like that?
Upvotes: 1
Views: 341
Reputation: 22032
The quickest way of doing it would be just to switch your app to use OAuth, the package your using already supports it https://github.com/sherlock1982/ews-managed-api/blob/master/Credentials/OAuthCredentials.cs . You just need to use something like the MSAL library https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-authenticate-an-ews-application-by-using-oauth to acquire the Token and replace your credentials code. eg
service.Credentials = new OAuthCredentials(TokenResult.AccessToken);
What the Managed API (or the port your using) doesn't do is token refresh so if your code runs from longer the 1 hour you need to be careful of the token expiration.
Upvotes: 1