Cannot login to Element desktop app anymore in Whonix

I did a fresh install of Qubes 4.3.0 today, but now I cannot login to the Element desktop app anymore in Whonix. This worked fine at least half a year ago.

Opening the Element app works fine. I select Sign In, leave the home server default matrix.org, and click Continue. I popup asks me if I want to open a URL in Tor Browser. I choose Yes. I login to my account in the web browser page that opened. It asks if I want to authorize the new device (the app I suppose), and I click Continue. Nothing happens in either the web browser or the Element app. Clicking Continue again causes an error message to appear that the device is already authorized, but nothing happens in the Element app. Even if I restart the Element app it stays at the login screen. Retrying does not help.

Obviously, something has broken in the new Qubes version, new Whonix version, or with an update to the Element app or home server software (the last two could have happened months ago, as I was already logged in before reinstalling now).

Any advice? Or should I file a bug ticket, and in that case against whom?

Have you tried other clients? Looks like matrix server or maybe client problem to me.

I tried the web client too, but it never loaded. But I don’t think it worked before either due to Tor Browser hardenings, so I am not certain it is supposed to work.

The desktop client used to work. I looked around a bit, and it sounds like when I click to authorize device, the web browser is supposed to launch Element desktop app with a certain “element://” URL. The Element desktop app is supposed to have registered itself as a handler for such URLs. But that does not work with Tor Browser, which sounds reasonable. But all this is just a guess. I think before you could just login with username and password in the app itself. All this going through the web browser thing is new.

I hope someone on here that is using Element has any suggestion.

This sounds like it should work even if element won’t open automatically. Assuming you can see the device as authorized in your profile afterwards.

This seems like the real issue, perhaps matrix server prevents access from tor?

If you can get the link, can you try to open it using element manually?

1 Like

I would think people would scream louder if they have started blocking Tor users from logging in.

Oh, that might work actually. I am going to try that tomorrow. Thank you for the suggestion.

This worked wonderfully. I am now logged in into my Matrix account in the Element desktop app on Whonix workstation.

It is a bit tricky, so I write the steps here for anyone else who stumble on this thread:

  1. Install and open the element-desktop app the usual way.
  2. Select to Login, and click Continue.
  3. In the popup asking if you want to open the link in Tor Browser, choose Yes.
  4. In the browser, go to the hamburger menu → More tools → Web Developer Tools. Switch to the Network tab.
  5. Now proceed with logging in into your Matrix account in the web browser. On the question if you want to authorize the new device, choose Continue. At this point, seemingly nothing happened due to clicking that button, do not click it again.
  6. Instead, look at the Network web developer tools tab, and check the request that got “303 See Other” response code. Copy the value of the Location field. It should look something like io.element.desktop:/vector/webapp/?no_universal_links=true&state=...%3B%3Aelement-desktop-ssoid%3A...&code=... where the dots have your unique authentication values.
  7. Open a terminal, and execute /opt/Element/element-desktop 'io.element.desktop:/vector/webapp/?no_universal_links=true&state=...%3B%3Aelement-desktop-ssoid%3A...&code=...', of course replacing the link with the real one.
  8. You will now be logged in in the already open Element desktop window, and it will ask for your security key as expected, and after having entered it, you now have access to all your chats.
1 Like