With reference to Cloud Integration – Connect to Microsoft 365 Mail with OAuth2 | SAP Blogs
- In most cases, the mailbox used with applications is not a user mailbox but a shared mailbox
- Shared mailboxes do not have separate login credentials/password
- An Application administrator logs in to Azure AD and register the application
- In our case, we used the shared mailbox email address in username field of OAuth2 authorization code form in CPI and when we authorize it asks for a password
All the necessary steps required from Exchange/Office 365/Azure AD have been performed as per Authenticate an IMAP, POP or SMTP connection using OAuth | Microsoft Docs
- added POP, IMAP permission to AAD application
- granted tenant admin consent
- registered service principal in Exchange
- granted application permission on shared mailbox
When connecting to a shared mailbox access using OAuth, is SAP able to obtain the access token on behalf of a user and replace the userName field in the SASL XOAUTH2 encoded string with the email address of the shared mailbox?