Bug 513481

Summary: Akonadi fails to create EWS OAuth account.
Product: [Frameworks and Libraries] Akonadi Reporter: S.Trzmiel <xeno>
Component: EWS ResourceAssignee: kdepim bugs <pim-bugs-null>
Status: REPORTED ---    
Severity: normal CC: carl, krissn
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Akonadi_ews agent messages
Akonadi server messages
Systemlog akonadi entries

Description S.Trzmiel 2025-12-17 14:37:35 UTC
Created attachment 187736 [details]
Akonadi_ews agent messages

SUMMARY
On fresh install of Fedora 43 I cannot create EWS account that uses OAuth auth scheme for my work.
I can open configuration window, put correct data, login to MS auth service, but no config files are saved, no account is visible in akoandiconsole

STEPS TO REPRODUCE
1.  Open 'Account configuration' via KMail configuration or Akonadiconsole, select Microsoft Exchange Server (EWS) 
2. Fill 'account name' and 'E-mail' fields with correct data
3. Select OAuth2 (Office365) as authentication method and click 'Try to connect' button
4. Login to MS account (here used username/pass and sms message steps).

OBSERVED RESULT
Once auth code from SMS is provided, connection window quickly flashes, then both auth window and account configuration windows close. No account is created, no account files appear in ~/.config/ and ~/.config/akonadi, however agents count in ~/.config/akonadi/agentsrc file is bumped.

EXPECTED RESULT
Once account configguration is closed, account is created and visible both in akonadiconsole and kmail settings. in KMail there should be visible EWS mails folder.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
KDE Applications 25.12.0
Qt Version: 6.10.1
Kernel Version: 6.17.11-300.fc43.x86_64 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
If I copy akoandi_ews agent config files from my old laptop (also Fedora 43 upgraded from past releases) and add it to agentsrc files, account is visible with correct data, but it fails to authenticate. Attempt to connect and reset authentication data has no effect. ie I can login to MS site, but no auth data are saved and akonadi is unable to retrieve folder subscriptions.

I attach akonadi related from system log (from the moment akonadi server was started to the last entry about ews account) and messages captured in akonadiconsole.
Comment 1 S.Trzmiel 2025-12-17 14:38:04 UTC
Created attachment 187737 [details]
Akonadi server messages
Comment 2 S.Trzmiel 2025-12-17 14:38:21 UTC
Created attachment 187738 [details]
Systemlog akonadi entries
Comment 3 S.Trzmiel 2025-12-22 10:28:34 UTC
Ok, so did small experiment and copied all akoandi EWS agents config files, adjusted agentsrc and imported akonadi-ews dir from my old kwallet to my current one and now KMail after refresh auth data it's able to sync folders. So it's a matter of akonadi-ews esource not talking to kwallet.  t least not one using GPG key to encrypt, which btw is the way recommended by KWallet itself.