Bug 481400

Summary: Login using Personal Access Token
Product: [Applications] Ruqola Reporter: Daniel Eckl <daniel.eckl>
Component: backendAssignee: Laurent Montel <montel>
Status: RESOLVED FIXED    
Severity: wishlist CC: daniel.eckl
Priority: NOR    
Version First Reported In: 1.9.2   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 2.2.0
Sentry Crash Report:

Description Daniel Eckl 2024-02-16 08:22:11 UTC
SUMMARY

Login via Personal Access Token (PAT) seems not possible.
The company internal instance of rocket chat uses an SSO login. I understand that OAUTH2 login is not yet possible. But I wonder if login via PAT would be possible. So I created a PAT and used it as User and Password but to no avail, it only answers "wrong username or password", so I guess this is not that easy and has to be implemented as well.

I hope this way perhaps is more easy than completing OAUTH2 login and I'd like to ask you to please look into that.

Thank you very much!

STEPS TO REPRODUCE
1. Access your profile settings to create a PAT
2. Use the credentials shown in Username and Password field of your ruqola server settings and click "login"

OBSERVED RESULT
Notice message "wrong username and password"

EXPECTED RESULT
being logged in

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro Linux
(available in About System)
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12

ADDITIONAL INFORMATION
Comment 1 Laurent Montel 2024-02-16 10:12:21 UTC
Hi,
I need to look at how work "Login via Personal Access Token"  I never tested it.
I will work on it soon.
Regards
Comment 2 Laurent Montel 2024-02-20 07:16:22 UTC
Can you create PAT in your server ?
Comment 3 Daniel Eckl 2024-02-20 17:30:13 UTC
Yes, on my company server I can create PAT and I know they work because they do with Pidgin RocketChat Plugin (which has other serious issues, so that's no alternative for me)
Comment 4 Laurent Montel 2024-02-20 18:27:09 UTC
Ok good to know.
I work at the moment to implement it.

I spoke with RC dev too and I have some idea for implementing it and add more features too.

I hope to fix/implement it this week.
Regards
Comment 5 Daniel Eckl 2024-02-20 18:28:58 UTC
That would be awesome, thank you so much for your work. I will do my very best to build it from git as soon as a first poc is ready.
Comment 6 Laurent Montel 2024-02-20 18:31:29 UTC
In git master it's only qt6.
=> better to use flapak if you don't have kf6 environment.
Comment 7 Daniel Eckl 2024-02-20 18:33:00 UTC
Oh cool, if you are able to provide flatpak afterwards, this would be wonderful! Thank you so much
Comment 8 Laurent Montel 2024-02-20 18:42:14 UTC
We already have it
(ok in master it was broken last week and I reactivate it this evening patch in progress)
Comment 9 Laurent Montel 2024-02-26 07:44:39 UTC
Just for info:
- I rewrote create account dialog => now it supports password login + other method as plugins
- I started to migrate ddp api (real live api) to REST API (necessary for it)
- I started to adapt login method for using it.

=> still in progress. I hope to finish it this week.
Comment 10 Laurent Montel 2024-03-22 12:15:53 UTC
Git commit 9def6f246e665aa779ad7f24ebe049f1c4154a63 by Laurent Montel.
Committed on 22/03/2024 at 12:14.
Pushed by mlaurent into branch 'master'.

Fix bug 481400:  Login using Personal Access Token

now authentication by personal access token is possible
FIXED-IN: 2.2.0

M  +6    -1    src/core/authenticationmanager/authenticationmanagerbase.cpp
M  +2    -0    src/core/authenticationmanager/authenticationmanagerbase.h
M  +4    -4    src/plugins/authentication/personalaccesstoken/personalaccesstokenauthenticationinterface.cpp

https://invent.kde.org/network/ruqola/-/commit/9def6f246e665aa779ad7f24ebe049f1c4154a63
Comment 11 Daniel Eckl 2024-03-25 06:41:51 UTC
I'm using Ruqola nightly right now and PAT Login works flawlessly, thank you so much!
Comment 12 Laurent Montel 2024-03-25 08:13:38 UTC
Waou ! great. Without problem etc ?
I implemented I verify that it works but you will test in production :)

Please report all bugs.
Thanks
Comment 13 Daniel Eckl 2024-03-25 11:17:54 UTC
I think the PAT part is absolutely flawless. I noticed that when I add a new server and enter the server url with a trailing slash like "https://chat.server.name/" the interface connects like forever, simply removing the slash works fine. I guess that was already the case before and this is unrelated.