GithubHelp home page GithubHelp logo

Unable to authorize client about slack-term HOT 14 OPEN

yllekz avatar yllekz commented on June 12, 2024
Unable to authorize client

from slack-term.

Comments (14)

shydefoo avatar shydefoo commented on June 12, 2024 16

Facing the same issue when using docker and from my local. My config is set correctly,

{
  "slack_token": "mytoken"
}
➜ slack-term -config ~/.config/slack-term/config
2022/06/22 08:28:25 not able to authorize client, check your connection and if your slack-token is set correctly

Anyone still facing this problem?

from slack-term.

Seanld avatar Seanld commented on June 12, 2024 14

Yes, I did some digging around in the code, and it turns out @bagnaram in #136 is correct.

The library that slack-term uses to interface with the official API is slack-go, but that (as far as I can tell) does not support this particular authentication method (xoxc token + xoxd token in Cookie header).

After cloning this repo, and cloning slack-go, and then forcing slack-term to use my local version of slack-go, and then modifying slack-go to shove my own personal xoxd token into the Cookie parameter in the headers of the API request, I was able to get slack-term connected.

slack-go will need a change to allow passing in and setting that particular header parameter in API requests.

slack-term will need a change to add a config option for the xoxd token that the user must also fetch somehow (easiest from the dev tools in the browser, I find). And it will need to pass that to slack-go when it creates a new API connection.

So, in summary, it's a two-headed problem. This app doesn't supply the xoxd token, and even if it did, the library it uses doesn't have the facilities to handle that. I'm going to try and work on an MR to submit here, and one to submit to slack-go.

I'm not sure why this doesn't seem to be a bigger issue for more people. Some comments in various threads on this problem mention that it's only newer workspaces. That seems like the most likely explanation.

from slack-term.

natefduncan avatar natefduncan commented on June 12, 2024 1

I experience the same issue but can get it to work if I specify the config location with the -config flag: slack-term -config ~/.slack-term or slack-term -config ~/.config/slack-term/config.

from slack-term.

ceandreasen avatar ceandreasen commented on June 12, 2024 1

I was able to bodge together a working proof of concept together by copying the chttp implementation from slackdump, which was referenced in the last comment of the above linked issue 1092

If it ends up meeting my needs, I'll try to put together a more proper implementation that takes the cookie as a config value rather than hardcoding it, though I don't really know Go so we'll see.

from slack-term.

hbak avatar hbak commented on June 12, 2024 1

^ ceandreasen's fork works.
Instructions on how to get xoxd token on this other project's readme: https://github.com/NoF0rte/slack-slurp

from slack-term.

rkpatel33 avatar rkpatel33 commented on June 12, 2024

Same issue, the Docker container works and can connect to my Slack account, but the binary does not. My config file is located at the following per the README:

~/.config/slack-term/config\

from slack-term.

yllekz avatar yllekz commented on June 12, 2024

Update: I apparently had comments in my config file (JSON doesn't support comments and neither does the app).

I got this to work:

sudo docker run -it -v ~/.config/slack-term/config/.slack-term:/config erroneousboat/slack-term

But this still does not work:
slack-term -config ~/.config/slack-term/config/.slack-term

I will happily use the Docker container though.

from slack-term.

hallvors avatar hallvors commented on June 12, 2024

I wanted to test slack-term and I get this error too.

First attempt with method 4 (window.promt() trick, very clever :) ), then method 2 https://github.com/erroneousboat/slack-term/wiki#method-2 . I got two different tokens, and neither of them worked :(

$ docker run -sh -v /home/[username]/.config/slack-term/config:/config erroneousboat/slack-term
2022/04/27 08:45:26 not able to authorize client, check your connection and if your slack-token is set correctly
$ ./slack-term-linux-amd64
2022/04/27 10:46:44 not able to authorize client, check your connection and if your slack-token is set correctly

from slack-term.

hallvors avatar hallvors commented on June 12, 2024

(I also ran docker run -sh -v /home/[username]/.config/slack-term/config:/config --entrypoint /bin/sh erroneousboat/slack-term to check that the config file was mounted correctly in /config with the token, and that I could ping servers on the 'net from inside the container - just in case. All seemed fine.)

from slack-term.

lepe avatar lepe commented on June 12, 2024

First, the default config file is in ./config/slack-term/config (its a file, not a directory).

When installing it via snap, that config file is stored in:

~/snap/slack-term/current/.config/slack-term/config

(you can confirm as it is created automatically).

You need to edit that file and add your token there. You can also add other config options as specified.

When updating slack-term that file is very likely to be removed, so keep a copy somewhere.

from slack-term.

pandruszkow avatar pandruszkow commented on June 12, 2024

I'm affected by the same issue.

from slack-term.

robrecord avatar robrecord commented on June 12, 2024

Thank you @Seanld . Would love to see a fix for this issue.

In slack-go they are working on something at slack-go/slack#1092

from slack-term.

thomas-scrace avatar thomas-scrace commented on June 12, 2024

I have this problem too.

from slack-term.

ceandreasen avatar ceandreasen commented on June 12, 2024

@thomas-scrace sorry for the slow reply. I have a working version here in my fork. It's still messy but you can now specify the additional token from the config value slack_xoxd_token and it's been working for me all summer.

I had to do some funny stuff with dependencies to make it work that I don't really recall the details of any more, probably not all up to snuff at all, but if someone who knows how Go works wants to clean it up be my guest.

from slack-term.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.