We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ExchangeImpersonation SOAP header must be present for this type of OAuth token

I am implementing OAuth2 for EWS. After getting the token when I make a request for connection to mail box it is throwing the below error.

“ExchangeImpersonation SOAP header must be present for this type of OAuth token.”

For impersonating the user I need to instantiate IEWSClient before connecting.

Aspose version : 20.9.1
Language : C#

Hi Team,

Any update on this issue.


Please upgrade to the latest version of Aspose.Email for .NET 22.8 and let us know how it goes on your side.

We suggest you please read the following thread to implement OAuth2 for EwsClient. Hope this helps you.


If you are not able to download the code from other forum thread, please download the code examples from here:
EWSModernAuthenticationApp.zip (3.4 KB)
EWSModernAuthenticationImapSmtp.zip (3.9 KB)
EWSModernAuthenticationDelegated.zip (3.6 KB)

A post was split to a new topic: Modern Authentication code examples