Bug 351892 - online banking passwords not stored/remembered
Summary: online banking passwords not stored/remembered
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: onlinebanking (show other bugs)
Version: 4.7.2
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on: 387062
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-28 11:05 UTC by Swj
Modified: 2019-08-29 00:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.8.2
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Swj 2015-08-28 11:05:53 UTC
I installed KMyMoney on a new computer running Windows 10 and then copied my .kmy file from my old computer running Windows 7.
Now when I do Account.Update Account it asks me for a password every time, instead of storing the the online banking password in kwallet as before.

Reproducible: Always

Steps to Reproduce:
1.  install KMyMoney on windows 10
2. copy a .kmy file over
3. open an account mapped to online banking 
4.  select Account.Update Account

Actual Results:  
asked for password every time

Expected Results:  
password stored in kwallet, not asked for password after 1st time.
Comment 1 Christian David 2015-08-29 15:40:08 UTC
Which online banking are you using? HBIC/aqbanking or OFX?
Comment 2 Swj 2015-12-29 02:24:54 UTC
I am using OFX, but I found that I needed to edit each account and check the "store password" option and then it works again.
Comment 3 Ralf Habacker 2017-11-15 05:57:39 UTC
kwalletd is not available on Windows - it is required to find out what is used on Windows to store ofx passwords. If this happens inside kmymoney, the related source code should give informations about this. If not this will be probably libofx.
Comment 4 Thomas Baumgart 2017-11-15 07:00:49 UTC
The password is stored inside the KMY file with the accounts kvp in case kwallet is not available and the password should be remembered. The relevant code can be found in

bool KOnlineBankingSetupWizard::chosenSettings(MyMoneyKeyValueContainer& settings)
Comment 5 Ralf Habacker 2017-11-15 16:11:06 UTC
Do I understand the following code from the mentioned function 

      if (m_storePassword->isChecked()) {
        if (d->m_walletIsOpen) {
          QString key = OFX_PASSWORD_KEY(settings.value("url"), settings.value("uniqueId"));
          d->m_wallet->writePassword(key, settings.value("password"));
          settings.deletePair("password");
        }
      } else {
        settings.deletePair("password");
      }

correctly that if wallet is not open the password will be simply deleted ?
Comment 6 Ralf Habacker 2017-11-16 22:47:28 UTC
Git commit 704ef3376ca9889b6ceab3cbf9166b407a7133fa by Ralf Habacker.
Committed on 16/11/2017 at 22:46.
Pushed by habacker into branch 'master'.

Add ofx test web service to www.kmymoney.org

A  +154  -0    ofxtest.php

https://commits.kde.org/websites/kmymoney-org/704ef3376ca9889b6ceab3cbf9166b407a7133fa
Comment 7 Ralf Habacker 2017-11-16 23:41:21 UTC
(In reply to Ralf Habacker from comment #6)
> Add ofx test web service to www.kmymoney.org
> 
Service does not work on public kde server - filed a sysadmin request https://phabricator.kde.org/T7461

Assigning an ofx online account using this service running on a local host with kmymoney 4.8.1 on Windows 10 showed that the passwords is indeed saved in the kmymoney file.

Unfortunally this does not explain why the passwords are lost on an update to Windows 10.
Comment 8 Ralf Habacker 2017-11-17 20:19:47 UTC
(In reply to Ralf Habacker from comment #7)
> (In reply to Ralf Habacker from comment #6)
> > Add ofx test web service to www.kmymoney.org
> > 
> Service does not work on public kde server - filed a sysadmin request
> https://phabricator.kde.org/T7461
Service works now including a simple account update - ofx testing should now be possible for anyone without having a dedicated ofx account.
Comment 9 Ralf Habacker 2017-11-17 20:51:16 UTC
(In reply to Ralf Habacker from comment #7)
> Unfortunally this does not explain why the passwords are lost on an update
> to Windows 10.
I can reproduce the issue with kmymoney 4.8.1 on Windows 10 by using the following steps:
1. I created a file configured with an ofx online account on Windows 7
2. I copied the file to a Windows 10 system and opened this file with kmymoney 4.8.1
3. An online account update of the mapped account is performed without asking any password
4. Opening the account settings shows an uncheck "save" check box and no password in shown
5. Saving account settings deletes the password from the kmymoney file and password is requested on next account online update

The bug seems to be in KOnlineBankingSetupWizard::walletOpened(bool ok) where the password save checkbox is only enabled if a wallet is open 

  m_storePassword->setEnabled(d->m_walletIsOpen);

Entering the password again and checking the "save" checkbox saves the password in the kmymoney file (with a notice that is is saved as clear text), but after reloading the file the "save" checkbox is unchecked again. 

Further opens of the account settings and saving without reentering the password and checking the 'save' checkbox deletes the password from the kmymoney file.
Comment 10 Jack 2017-11-20 21:35:16 UTC
Can you give more information about how to actually use this ofx test web service, and what types of requests it is able to reply to?
Comment 11 Ralf Habacker 2017-11-20 22:08:38 UTC
Open https://kmymoney.org/ofxtest.php in a browser - I hope it will give you the required information
Comment 12 Ralf Habacker 2017-11-20 22:19:42 UTC
> The bug seems to be in KOnlineBankingSetupWizard::walletOpened(bool ok)
> where the password save checkbox is only enabled if a wallet is open 
> 
>   m_storePassword->setEnabled(d->m_walletIsOpen);
> 
One option is to let Windows behavior exactly as on non Windows - to add kwalletd to the Windows installation. This would be possible with 4.8.2.
Comment 13 Ralf Habacker 2018-06-01 20:11:38 UTC
kwalletd was added to windows installer and portable package.