How to get dual authentication to work with EWS in C# RRS feed

  • Question

  • I have an EWS application to push notifications whenever there is a new email for any exchange email account. Currently I am supporting basic authentication with username/password of the user account:

    exchangeService.Credentials = new WebCredentials(UserName, Password);
    PushSubscription subscription = exchangeService.SubscribeToPushNotifications(
                                        new[] { this.inboxFolder },
                                        new Uri(postBackUrl),

    Going further, I am supposed to support dual authentication like basic+CBA. In iOS email client (for which my EWS service pushes notifications), does the same for exchange activesync with some challenge callback from the exchange. Is there a way to achieve the same in EWS managed APIs?

    Update: My further investigations indicate that if the EWS service is configured to have dual authentication (password + certificate together), then I will receive an exception as a result of first authentication and once I receive that exception I am supposed to provide the certificate for the second authentication. Anyone knows what error can I expect to make sure I am supposed to present the certificate now?

    Tuesday, March 20, 2018 10:08 AM