Unable to sign in to Slack snap app

7,704

Solution 1

Faced this issue on a snap install of Slack. Using Firefox rather than a Chromium-based browser did the trick.

Solution 2

Copy the link from the browser and run

xdg-open slack://...yourlink

in your terminal.

Solution 3

2022 edit: This answer is old. Snap added slack as an allowed url scheme. See https://github.com/snapcore/snapd/blob/master/usersession/userd/launcher.go ~line 100.

This is because snap does not allow you to use special url schemes like slack:// . So chrome tries to open it but it is blocked. If you use firefox from apt you don't have this error and it will work fine (even if you use slack from snap). The error shows in your syslog:

user-open error: Supplied URL scheme "slack" is not allowed

To login using chromium anyways, at the bottom the page says this:

App didn't open? Try again, or sign in to Slack for the browser.

Right click "Try again" select "Copy link address" and with that in your clipboard just go back to slack. Slack will see the url in your clipboard and log you in.

Note: The fact this works is a slack feature. This does not work for other applications like zoom, unless of course they have this feature build-in as well.

Solution 4

Add the x-scheme-handler to your mimeinfo.cache like so:

$ echo "x-scheme-handler/slack=slack.desktop;" >> ~/.local/share/applications/mimeinfo.cache

make sure you have a slack.desktop file either in /usr/share/applications/ or ~/.local/share/applications/

If you don't then try this.

$ slack=$(which slack); cat > ~/.local/share/applications/slack.desktop << ENDL
[Desktop Entry]
Name=Slack
StartupWMClass=Slack
Comment=Slack Desktop
GenericName=Slack Client for Linux
Exec=$slack
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Network;InstantMessaging;
MimeType=x-scheme-handler/slack;
ENDL

then cat ~/.local/share/applications/slack.desktop and make sure Exec= points to slack.

If this doesn't work, try

$ sudo apt install inotify-tools
$ inotifywait -m ~/.local/share/applications/{slack.desktop,mimeinfo.cache}

and see if those files are being opened. If this is still failing just comment below with your issues and I'll come back and tell you next steps. It was pretty frustrating only finding wrong answers for this question on the internet, I know your pain.

Share:
7,704
jaymullr
Author by

jaymullr

Updated on September 18, 2022

Comments

  • jaymullr
    jaymullr almost 2 years

    I've done sudo snap install slack --classic and now have the Slack snap application (v. 4.1.2). When I run slack from the terminal, it opens the app, with the sign in button. Clicking this opens the Slack login page in my default browser (chromium, snap app v. 78.0.3904.108), where I successfully login.

    The trouble is that it says, "Signing you in to Slack. You should be redirected in a few moments." Then, a pop-up appears: "Open xdg-open?" I select "xdg-open" (instead of "cancel") and then......nothing happens. The Slack snap app still shows the sign in page, while the browser thinks I've logged in and just says "Signing you in to Slack."

    Is this because of sandboxing issues with the Chromium snap app? I'd love for my Slack (multiple workspaces) to be in a separate app, instead of being trapped in a browser tab, so any and all help resolving this would be greatly appreciated! And apologies if this is posted in the wrong place; I'd be keen to know anywhere else that might better fix this.

    Other possibly relevant details:

    • Hardware: 2015 Macbook Pro 13" Retina
    • OS: LXLE 18.04
  • Qortex
    Qortex almost 4 years
    I can confirm it works on Fedora 32 as well.
  • hamx0r
    hamx0r over 2 years
    It also works on Pop! OS 20.04
  • Angelo Vargas
    Angelo Vargas over 2 years
    This works well but you need to specify %U in the Exec command so that it can correctly work. Example: Exec=$slack %U
  • panta82
    panta82 over 2 years
    This did the trick for me. Fedora 35 KDE.
  • KeatsKelleher
    KeatsKelleher over 2 years
    Worked for me! running ubuntu/KDE