Can't add Office365 account (Authentication Error - Check your username and password. (SMTP))

Description

To Reproduce…

Steps to reproduce the behavior:

  1. Got to add an account
  2. Select Office365
  3. Insert credentials in browser
  4. image

Expected Behavior

OAuth setup successfully

Setup

  • OS and Version: Windows 11 Pro 10.0.22000 Build 22000
    • Installation Method: installer
  • Mailspring Version: 1.9.2-6e14dad1.

I’m seeing similar behaviour in V1.10.0 when trying to reconnect/reauthenticate my Office 365 account:

Sorry we had trouble logging you in.

OAuth Code exchange returned 400 Bad Request: {“error”:“invalid_request”,“error_description”:“AADSTS9002327: Tokens issued for the ‘Single-Page Application’ client-type may only be redeemed via cross-origin requests.\r\nTrace ID: 07387f22-5043-4264-a6b7-275ccdf66200\r\nCorrelation ID: 6abfd984-2b66-46b1-a228-1dac6f1d133b\r\nTimestamp: 2022-03-01 13:35:45Z”,“error_codes”:[9002327],“timestamp”:“2022-03-01 13:35:45Z”,“trace_id”:“07387f22-5043-4264-a6b7-275ccdf66200”,“correlation_id”:“6abfd984-2b66-46b1-a228-1dac6f1d133b”}

Many of us will have limited control over our Office365 account settings as they’re tied to institutions/businesses.

I am getting the same error as TJC today.

We were able to fix this via messing around with office365 settings, I don’t know which setting fixed it since after messing around with quite a few of them it started working later.

I’m having this same exact issue.

Arimil, were you adjusting settings on the management side or as a 365 user?

For what it’s worth: I’ve been trying out a few different email clients and one thing I noticed is when the other clients used OAuth for the first time, Microsoft would as me if I wanted to allow certain permissions, and I had to hit “yes”.

I never received such a request for mailspring. It just jumped to “You’re all set!” and then failed.

Changes were made on the management side, Mailspring appears to still be using SMTP to send mail. I’ve seen other solutions not need this, I assume they’re using OAuth and the Office365 API instead.

Hi,

Just installed Mailspring 1.10.3 as a snap under Ubuntu 22.04 Desktop. Having exaclty the same issue.

I can see that “Fix login to Office 365 Accounts” should be fixed in this release, but still not working for me at least.

Is this a know issue being worked on or not?

OK, so this solved it for me: Enable or disable SMTP AUTH in Exchange Online | Microsoft Docs

1 Like

Fantastic!!! Thanks very much - this worked for me too!

Enabling SMTP auth is a really bad practice and not a solution to the problem:

1 Like

I thought they added OAUTH authentication to Mailspring? I guess they forgot to add it for SMTP then?