SMTP XOAUTH2 Authentication unsuccessfull

Özgür Pir 26 Reputation points
2022-10-12T09:56:43.003+00:00

Hello,

I've get token via /token endpoint with the fields below:

client_id, client_secret, tenant, grant_type: client_credentials and scope: https://outlook.office365.com/.default

I can not send SMTP XOAUTH2 mail. Get an error: Authentication unsuccessful. What I'm missing? Can anyone help me?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,330 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,275 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shweta Mathur 29,016 Reputation points Microsoft Employee
    2022-10-12T15:19:21.923+00:00

    Hi @Özgür Pir ,

    Thanks for reaching out.

    Currently, SMTP Oauth 2.0 client credential flow with non-interactive sign in is not supported.

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful