Bug 331576

Summary: password needed at dialog every connect
Product: [Applications] krdc Reporter: dexy
Component: generalAssignee: Urs Wolfer <uwolfer>
Status: REOPENED ---    
Severity: normal CC: ad_kde, agurenko, byroniac, ctrlaltca, dpbasti, FishBoneEK, jerrysteve1101, lostfreeman, martin, postix, poub.clotilde, sighunter, testing1237a-c, tomas
Priority: NOR    
Version First Reported In: 24.12.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 25.04
Sentry Crash Report:

Description dexy 2014-02-27 18:55:07 UTC
KRDC configured - checkbox checked - to save passwords (Kwallet) in general configuration, but password needed at dialog every connect. 

Reproducible: Always



Expected Results:  
Re-connect to server should automatically log in there using saved password.
Comment 1 dexy 2014-02-28 02:08:37 UTC
Solved! Wallet problem.
Fresh install, Wallet system not enabled. Even then, problem: can't access wallet.
Cure:delete kdewallet, re-create kdewallet (with no password).
Comment 2 Andrew Crouthamel 2018-11-11 04:21:22 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Andrew Crouthamel 2018-11-21 04:26:06 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 4 byroniac 2019-02-22 20:55:15 UTC
I'm having this same problem with Ubuntu 18.10 using the Snap version of krdc. I have the snaps kde-frameworks-5 and kde-frameworks-5-core18 installed as well (do I even need both?). I even tried installing some kwallet packages using apt. I'm not very familiar at all with the kde system, as I've always used GNOME. Were it not for this bug, I'd love to try krdc a little more. I don't know how to delete and recreate a kdewallet, either.
Comment 5 Achmad Fathoni 2020-05-01 20:23:24 UTC
KRDC still asking password everytime in KDE Neon 18.04.
Comment 6 SigHunter 2024-06-19 12:32:31 UTC
Today I tried the new RDP feature of Plasma 6.1 and in general it works well!
however this bug still seems to be present, using KRDC 24.05.1.

I connect to a remote host via rdp for the first time, the "Password - KRDC" window pops up, 
I enter the credentials (user + pw) and check the box "Remember password".
It successfully connects. I close KRDC and reopen, connecting to the same remote host and it again asks for user and password.

I see in kwallet that it added a KRDC entry that also contains the used password, but does not show the username.
My kwallet has no password to open

Operating System: Gentoo Linux 2.15
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.9.5-gentoo-dist (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700K CPU @ 4.20GHz
Memory: 23.2 GiB of RAM
Graphics Processor: Mesa Intel® Arc
Comment 7 Antoine 2024-08-29 08:10:28 UTC
Also found this issue

Arch linux
KDE Plasma : 6.1.4
KDE Frameworks : 6.5.0
Qt version : 6.8.0

KRDC version : 24.08.0

Even with a properly configured wallet, seems that only password is stored. 
Need to re authenticate for each RDP session .
Comment 8 tomasmark79 2024-10-19 08:51:14 UTC
Installed KRDC via Apt package is working well with the KWallet.
Installed KRDC via flatpak will cause this errors:


```
[📦 org.kde.krdc ~]$ krdc
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
Couldn't start kwalletd:  QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "org.freedesktop.DBus.Error.ServiceUnknown")
KRDC: Starting RDP session
```
Comment 9 FishBoneEK 2024-11-01 14:05:04 UTC
Also having this issue. I didn't check if my KWallet is configured correctly, but i think KRDC should display an error if there's sth wrong with kwallet, instead of just doing nothing.

STEPS TO REPRODUCE:
1. Create a new RDP connection
2. Check "Remember password" when logging
3. Log in
4. Disconnect
5. Connect via remembered hosts

OBSERVED:
password asked

EXPECTED:
auto login
Comment 10 Jun Yan 2024-11-02 05:34:16 UTC
*** Bug 493603 has been marked as a duplicate of this bug. ***
Comment 11 Fabio 2024-12-08 10:20:04 UTC
This weird behavior is caused by the way krdc stores connections.
Connections are identified by the URL specified by the user, eg. rdp://192.168.1.1 or rdp://user@192.168.1.1
The username is retrieved from the URL, so if it's not present you will be asked at every connection to specify it again.
I've tried as workaround to force the username specified in the "request password dialog" in the saved URL, and it works, but this causes duplicate connections being saved.
Other problems exists in the way connections are stored, eg. there's no way to edit an existing connection URL.
I guess this section needs a major overhaul.
In the meanwhile, ensure the username is specified in the connection URL to ensure it will get saved.
Comment 12 Sebastian Turzański 2024-12-13 16:27:59 UTC
it does not work for me,
i added user@ to the connection name
i tried to connect 
i got empty login/password dialog
i entered both values and selected "remember passoword"
i got connected
i disconnected
i tried to reconnect
i got empty login/password dialog again
Comment 13 Fabio 2024-12-13 16:29:53 UTC
(In reply to Sebastian Turzański from comment #12)
> it does not work for me,
> i added user@ to the connection name
> i tried to connect 
> i got empty login/password dialog
> i entered both values and selected "remember passoword"
> i got connected
> i disconnected
> i tried to reconnect
> i got empty login/password dialog again

What version of krdc?
Can you try to open KWallet and see in the "KRDC" section an entry has been correctly added for "<user>@<server>"?
Comment 14 lostfreeman 2024-12-13 18:31:11 UTC
I ended up switching to freerdp due to this and other UX issues (key grabbing) and bugs (panel not appearing in fullscreen).

Wrote this script (NixOS config, add to systemPackages) and manually added the passwords to KWallet:

    (pkgs.writeScriptBin "lrdp" ''
          #!${pkgs.bash}/bin/bash
          if [ $# -lt 1 ]; then
            echo "Usage: $0 hostname"
            exit 1
          fi

          hostname="$1"
          echo "Connecting to $hostname"
          shift  # Remove hostname from arguments

          password=$(${pkgs.kdePackages.kwallet}/bin/kwallet-query -r "smb-$hostname:-1" -l kdewallet | jq -r .password)

          if [ -z "$password" ]; then
            echo "Password for smb-$hostname:-1 not found in KWallet"
            exit 1
          fi

          exec sdl-freerdp "$@" \
            /u:lost /p:$password \
            /v:"$hostname"
        '')
Comment 15 Sebastian Turzański 2024-12-14 09:44:11 UTC
(In reply to Fabio from comment #13)
> (In reply to Sebastian Turzański from comment #12)
> > it does not work for me,
> > i added user@ to the connection name
> > i tried to connect 
> > i got empty login/password dialog
> > i entered both values and selected "remember passoword"
> > i got connected
> > i disconnected
> > i tried to reconnect
> > i got empty login/password dialog again
> 
> What version of krdc?
> Can you try to open KWallet and see in the "KRDC" section an entry has been
> correctly added for "<user>@<server>"?

I had to delete the bookmarks that were there and add a new one with user@ then it worked.

still if there are is no user@ the dialog asks for user and password so both should be saved so definitly a bug
Comment 16 Berbigou 2024-12-17 17:45:08 UTC
@ Fabio 2024-12-08 10:20:04 UTC (Comment 11)
THANK YOU Fabio, it was driving me crazy ! Now my passwords are stored and retrieved !!

For others: 
1) connect with --> rdp://user@host.host.host.host
2) tick the "save password" box
3) disconnect
4) reconnect and enjoy

eventually, open kwalletmanager in KDE Plasma, delete the useless KRDC keys
Comment 17 postix 2024-12-21 21:28:34 UTC
Can confirm on openSUSE TW. The password is actually stored in kwallet, but krdc keeps asking.
Comment 18 postix 2024-12-21 21:30:37 UTC
The work around with user@ has not worked for me unfortunately.
Comment 19 postix 2024-12-21 21:37:01 UTC
*** Bug 455200 has been marked as a duplicate of this bug. ***
Comment 20 Fabio 2025-03-06 11:08:12 UTC
krdc now saves the username in the URL saved in the bookmark and in kwallet
This means that if you reopen the same connection, the username will be correctly used.
If you create a new connection to the same host without specifying an username the credentials won't be provided.
After all, you may want to be able to connect to the same host using different usernames.
Comment 21 Martin Fernau 2025-12-15 09:54:10 UTC
Bug is still present in KDE 25.10 with KRDC 25.08.1

I also have this bug and for me I need to change the url in KRDC from "rdp://[domain]\[user]@[host]" to "rdp://[user]@[host]?domain=[domain]" because this is the way KRDC store it in wallet.

The domain part was the important change for me.

This drives me crazy since months... 
Thank you!
Comment 22 Fabio 2025-12-15 13:59:22 UTC
Martin Fernau: you reopened this bug, but from your message it seems it works for you now.
It was intentional to reopen the bug? Is there something that still needs to be fixed for you?
Comment 23 Martin Fernau 2025-12-16 07:28:06 UTC
I’m not sure whether it is intentional that this only works if the connection URL is stored in a very specific format, or whether it should also work when the URL follows the commonly used domain login format
rdp://[domain]\[user]@[host].

KRDC is able to connect successfully in both cases, so the URL format itself is accepted and works for establishing the connection. However, when using the domain\user format, the saved password is not reused on reconnect.

Most likely this is caused by the URL not matching the entry stored in KWallet, so the credentials are not found again.

From my perspective, the bug is therefore still present: the system does not behave as one would reasonably expect.
My described solution is only a workaround, not a real fix.