Bug 414826 - Failed to open KDE Wallet to read Last.fm credentials
Summary: Failed to open KDE Wallet to read Last.fm credentials
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Services/Last.fm (other bugs)
Version First Reported In: 2.9.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: kf5
Assignee: Amarok Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-12-04 13:46 UTC by wojnilowicz
Modified: 2024-07-11 21:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wojnilowicz 2019-12-04 13:46:07 UTC
SUMMARY
Last.fm plugin in Amarok is not able to store provided username and password in KDE Wallet.

STEPS TO REPRODUCE
1. Go to "Settings->Configure Amarok..."
2. Go to "Plugins" page
3. Select "Last.fm" checkbox to enable this plugin
4. Click on configure button for "Last.fm" plugin
5. Enter username and password
6. Click on "Test login" button
7. Click on "OK" button

OBSERVED RESULT
Question at configuration end : No KDE Wallet is running. Do you want Amarok to save it in clear text?
Error at Amarok startup: "Failed to open KDE Wallet to read Last.fm credentials"

EXPECTED RESULT
Last.fm plugin should be able to connect to KDE Wallet.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.61
Qt Version: 5.12.5

ADDITIONAL INFORMATION
1) I suspect commit
https://cgit.kde.org/kwallet.git/commit/?id=dc5c7229bc4ff75506c34197da5450808c969efe
is to blame

2) After running "Amarok --debug" in terminal I get:

amarok:   BEGIN: LastFmServiceConfig::LastFmServiceConfig()
amarok(24318)/kdeui (Wallet): Couldn't start kwalletd:  "Nie można odnaleźć serwisu 'kwalletd.desktop'."
amarok:     [WARNING] [lastfm] void LastFmServiceConfig::slotWalletOpenedToRead(bool) failed to open wallet
amarok:   END__: LastFmServiceConfig::LastFmServiceConfig() [Took: 0.14s]
Comment 1 Tuomas Nurmi 2024-07-11 21:55:33 UTC
Git commit 588d8cef9d760b86586afebdd58e8ee32c77c09d by Tuomas Nurmi.
Committed on 11/07/2024 at 21:46.
Pushed by nurmi into branch 'master'.

Update last.fm login mechanism to use non-deprecated token method

The mobile session seems to be somewhat deprecated, and at least I'm not totally
confident that it is actually possible to log in new sessions with it any more in
Amarok.

Token-based method doesn't need password, so no new data is saved to kwallet in any
case. Tries to use existing session key from config file and username from config
file or kwallet. If username is saved to kwallet, tries to migrate it from there.
If this succeeds, everything should be transparent to user. If not, an error window
is shown and the account can be reconnected in plugin settings.

Thus also avoids any KWallet related bugs

M  +1    -0    ChangeLog
M  +20   -28   src/services/lastfm/LastFmConfigWidget.ui
M  +9    -71   src/services/lastfm/LastFmService.cpp
M  +0    -2    src/services/lastfm/LastFmService.h
M  +15   -140  src/services/lastfm/LastFmServiceConfig.cpp
M  +2    -12   src/services/lastfm/LastFmServiceConfig.h
M  +122  -41   src/services/lastfm/LastFmServiceSettings.cpp
M  +4    -1    src/services/lastfm/LastFmServiceSettings.h

https://invent.kde.org/multimedia/amarok/-/commit/588d8cef9d760b86586afebdd58e8ee32c77c09d