SMTP for O365 with client credentials flow

m2022 11 Reputation points
2022-10-13T09:24:20.577+00:00

Hi,

As per the note in the following documentation

"As per the current test with SMTP Oauth 2.0 client credential flow with non-interactive sign in is not supported."

https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#smtp-protocol-exchange

Is this still case as of today. If so is there any plan to implement Oauth with SMTP for Client Credentials flow.
Is there any alternative for this, as using interactive flow for background services might not be a suitable option for us.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,452 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Shweta Mathur 27,381 Reputation points Microsoft Employee
    2022-10-14T05:54:14.193+00:00

    Hi @m2022 ,

    Thanks for reaching out.

    Unfortunately, as of now there are no exact date to implement Oauth with SMTP for Client Credentials flow.

    For now, the best option is to use legacy authentication https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission.

    I understand you concern that basic authentication in Exchange Online is start deprecating and our recommendation is to migrate to OAuth2.

    However, As mentioned here SMTP AUTH will still be available when Basic authentication is permanently disabled. The reason SMTP will still be available is that many multi-function devices such as printers and scanners can't be updated to use modern authentication. However, we strongly encourage customers to move away from using Basic authentication with SMTP AUTH when possible. Other options for sending authenticated mail include using alternative protocols, such as the Microsoft Graph API.

    Hope this will help.

    Thanks,
    Shweta

    -------------------------------------------

    Please remember to "Accept Answer" if answer helped you.


  2. Jinit Jain 1 Reputation point
    2022-12-19T05:30:32.623+00:00

    Hello, I have changed the authentication from basic to OAuth for IMAP in my project and for SMTP authentication, I have kept the same authentication using email and password. Currently the app works fine with oauth IMAP and basic SMTP auth. Can I get a confirmation if it will work fine after 31st December 2022 and Microsoft is not going to diable SMTP.