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?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,188 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.