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

Free Support Forum - aspose.com

OAuth2 Java

Hi Team,

Can you provide me code sample for OAuth2 in Office365 using Java ?

Thanks and Regards,
Arne

@arne411

You can use the following code snippet to achieve your requirement.

// accessToken
NetworkCredential credentials = new OAuthNetworkCredential("accessToken");

IEWSClient client = EWSClient.getEWSClient("https://outlook.office365.com/ews/exchange.asmx", credentials);
client.listMessages();

For more detail, please read the following article.
Use SAAJ API

Hi Team,

thank you for the reference. Can you also let me know how I can get the access token?

I have a Microsoft account with login details and the modern authorization(OAuth2) enabled but could not see any access token in it.

Thanks and Regards,
Arne

@arne411

We have logged your requirement as EMAILJAVA-35046 in our issue tracking system. We will inform you via this forum thread once there is an update available on it. We apologize for your inconvenience.

Hi,

Is there any update on this issue?

best regards

Arne

@arne411

Hopefully, the fix of this issue will be available in the Aspose.Email for Java 22.5 release. Please note that this ETA is not final at the moment. We will inform you via this forum thread once there is an update available on it.