Reading Email from Microsoft365 with some limitations

How can we read email from Microsoft365 without using IMAP or OAuth2.0 Authentication via Client credentials and Password credentials grant types by using Microsoft Graph?

Is there any way to use Authorization code for OAuth2.0 Authentication by using Microsoft Graph?

@SiddharthaC1589 did you already see the following posts?

Failure to integrate Microsoft Office 365 Email Account with Microsoft Graph

Email Account Using Microsoft Graph As Receiver With Office 365 Email Provider In 8.4.3 Doesn’t Work

The main documentation is here:

Configuring OAuth 2.0 authentication for sending and receiving emails by using Microsoft Graph

@MarijeSchillern I believe you haven’t understood my question - our organization doesn’t allow to use OAuth2.0 Authentication via Client credentials and Password credentials grant types by using Microsoft Graph

All the link and documents you have shared, talking about Client Credentials GRANT Type.

My question - what alternative I have apart from these two GRANT type.

My organization OK with Authorization code Grant type, but looks like PEGA doesn’t support that.

Please correct me!!!

@SiddharthaC1589 many thanks for clarifying.

Did you already find the following related content?

These mention workarounds with some user intervention:

can Pega acts as a OAuth 2.0 Provider For either Authorization Code and Implicit Grant types

Issue OAuth2.0 Authorization Code

Pega 8.4 : Authentication Profile - Custom Provider miss Authorization code endpoint

Customized JWT token generated for Public OAuth 2.0 Client Registration using Authorization code grant type

@MarijeSchillern Thanks for those links!!! Those are very informative but not able to address my query :frowning:

Hello @SiddharthaC1589, Thanks for your question.

In OAuth2, there are several different ways to achieve access tokens, each suited for different scenarios. The email listener runs as a background process and there is no end-user authorization involved. This is a machine-to-machine authorization and most relevant grant types in a machiene-machiene authorization are “Client-Credentials” and “Password-Credentials” grant types.

There are also different ways how you exchange sensitive data, for example you could either use a secret or a certificate for exchanging the credentials in an “Client-Credentials” grant. you can choose it based on your organizational security policies.& guidelines.

“Authorization-Code” grant is an interactive grant and it requires end-user authorization to be able to get the token. Hence you won’t be able to use “Authorization Code” grant type with email listeners.

Thank You!