simonrob / email-oauth2-proxy

An IMAP/POP/SMTP proxy that transparently adds OAuth 2.0 authentication for email clients that don't support this method.
Apache License 2.0
785 stars 84 forks source link

Office 365 new aplication get ERR Authentication failure: unknown user name or bad password #244

Closed rcaloMMT closed 3 months ago

rcaloMMT commented 4 months ago

Hi, we have been successfully implement the proxy for a year, last week we try create a new app followimg the same steps as before, but now we alway get the same error, we are sure about the user y pass because we can login through the browser

2024-04-29 13:13:27: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995) --> b'USER user@domain.com\r\n' 2024-04-29 13:13:27: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995) <-- b'+OK\r\n' 2024-04-29 13:13:27: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995) --> b'PASS xxxxxx\r\n' 2024-04-29 13:13:27: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995) --> b'AUTH XOAUTH2\r\n' 2024-04-29 13:13:27: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995) <-- b'+ \r\n' 2024-04-29 13:13:36: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995; user@domain.com) <-- b'-ERR Authentication failure: unknown user name or bad password.\r\n' 2024-04-29 13:13:36: POP (10.1.2.90:64286-{172.15.0.1:1995}-outlook.office365.com:995; user@domain.com) <-- b'-ERR Authentication failure: unknown user name or bad password.\r\n'

i saw a similar issue but don't say how he solved, any idea?

Office 365 CCG always ends in ERR Authentication failure: unknown user name or bad password #238

simonrob commented 4 months ago

I presume you removed one or more outgoing lines from the proxy log between 2024-04-29 13:13:27 and 2024-04-29 13:13:36 (the submission of the OAuth 2.0 token). Assuming this is present, I would suspect some sort of misconfiguration on the Azure/Entra side.

rcaloMMT commented 3 months ago

as you say, the problems was on a MS config.

Thanks,.