Bug 414789

Summary: Authentication failed even though server replies Auth is ok
Product: [Frameworks and Libraries] Akonadi Reporter: Ovidiu-Florin BOGDAN <kde.kfoar>
Component: EWS ResourceAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal CC: hujq, krissn
Priority: NOR    
Version: 5.11.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Ovidiu-Florin BOGDAN 2019-12-03 09:46:48 UTC
SUMMARY
I'm trying to authenticate to a mailbox on outlook.office365.com using the Username/Password authentication method.

The auto discovery of the domain works fine, but as soon as the account config is saved I get a "Authentication failed" error. The company IT reports that the authentication is successful.

A short test with the https://github.com/ecederstrand/exchangelib library, with the same username and password was able to list my emails. I used the example from their readme.

STEPS TO REPRODUCE
1. Create new EWS account from KMail config -> Add custom account
2. Enter my username and password, domain disabled
3. Click OK

OBSERVED RESULT
Account status shows: "Authentication failed"

EXPECTED RESULT
Account to connect and see my emails.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 31 KDE
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.61.0
Qt Version: 5.12.5
Comment 1 Igor Poboiko 2020-03-20 16:10:46 UTC
Git commit 7afd99abbfa141f6e6dfbe69b01827af8f16ba27 by Igor Poboiko.
Committed on 20/03/2020 at 16:10.
Pushed by poboiko into branch 'master'.

[resources/ews] Save password to wallet

Summary:
Seems like the password entered via the UI actually never gets saved anywhere.
Just do it explicitly.
Related: bug 393002, bug 390798, bug 402780

Test Plan:
1) Try to setup EWS account using autodiscovery, using Username/Password auth
2) Set Username, Password, hit "Try connect" -> it works fine
3) Hit "OK" -> observe "Authentication failure" resource error
4) Browse `akonadi-ews` via `KWalletManager` -> it's empty
5) Apply the patch, repeat 1-4 - authentication succeeds, password entry inside wallet appears

Reviewers: dvratil, nowicki

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27813

M  +1    -0    resources/ews/ewsconfigdialog.cpp

https://commits.kde.org/kdepim-runtime/7afd99abbfa141f6e6dfbe69b01827af8f16ba27