ferdium / ferdium-app

All your services in one place, built by the community
https://ferdium.org
Apache License 2.0
2.94k stars 176 forks source link

Rocket.Chat oAuth window opens in browser #1420

Open betterphp opened 1 year ago

betterphp commented 1 year ago

Avoid duplicates

Ferdium Version

6.5.2 (AppImage)

What Operating System are you using?

Ubuntu

Operating System Version

Ubuntu 23.04

What arch are you using?

x64

Last Known Working Ferdium version

No response

Expected Behavior

The login window should open in the app and the oAuth process should complete

Actual Behavior

The login window opens in Firefox (even with the open URLs in Ferdium setting enabled) which means there's no way to sign in.

Steps to reproduce

  1. Set up a self-hosted Rocket.Chat instance and configure SSO using GitLab
  2. Try and login

Debug link

No response

Screenshots

https://github.com/ferdium/ferdium-app/assets/788007/8ffec657-69f9-485d-a4f6-b717b0acfea9

Additional information

No response

ddomhoff commented 1 year ago

Also applies to 6.6.0 on windows and 6.5.2 on macOS. Here login is also not possible with custom oAuth provider configured in Rocket.Chat and with die pre-configured Nextcloud-oAuth settings.

betterphp commented 1 year ago

The same thing happens on 6.6.0 for me too (AppImage on Linux)

KalebVargo commented 12 months ago

I am getting the same behavior with my setup on Windows with 6.6.0

davidlafon commented 11 months ago

Same issue here, on Mac:

vraravam commented 10 months ago

you can right-click on the link and choose "Open link in Ferdium" - this is different from the setting.

JochenLutz commented 10 months ago

you can right-click on the link and choose "Open link in Ferdium" - this is different from the setting.

Sorry to say, but that does not help here.

I analyzed Rocket.Chat's login page when using CAS:

Would it be feasible to use user.js to replace the button with a real link? Or does this need another approach?

vraravam commented 10 months ago
  1. I dont use Rocket chat and so i can't comment on what it shows.
  2. you can try the user.js method, but again, i can't comment whether it would work or not.
  3. In Ferdium, we usually dont do such hacks that can change the page being rendered. Its left upto the user to decide and code such behavior

Also, please upgrade to the latest version before trying - so that we are all on the same page when referring to inconsistent behavior of the app

remche commented 9 months ago

I've found this hacky workaround waiting for issue to be resolved (I sadly have not time to give and almost no knowledge in Ferdium recipes baking...) :

  1. Login on your daily browser
  2. Open DevTools console, retrieve Meteor.loginToken from Local Storage : localStorage.getItem("Meteor.loginToken")
  3. Open Service Developer Tools console in Ferdium and insert the token in Local Storage: localStorage.setItem("Meteor.loginToken", "token")

Hope it helps !

darylounet commented 8 months ago

Great workaround @remche ! Thank you !

If you want to have autologin when you open Ferdium, you can edit Rocket.Chat service, then at bottom "Open user.js" and put this code :

module.exports = (config, Ferdium) => {
  // Write your scripts here
  console.log("Hello, World!", config);

  if (config.url.includes("your.rocket.chat.host.net")) {
    localStorage.setItem("Meteor.loginToken", "your-token");
  }
};

You can also create a personal access token that don't expire (on your Rocket.Chat host at /account/tokens path) instead of retrieving it on your browser :)