wee-slack: Session tokens no longer working
This morning my session token expired. I logged in to my browser and got a new one, but wee-slack can’t log in with it:
ERROR: Failed connecting to Slack with token xoxc-...: invalid_auth
I’ve been using session tokens for several months and getting new ones every time they expired, and this is the first time I’ve had any issues.
IssueHunt Summary
trygveaa has been rewarded.
Backers (Total: $432.00)
yardenac ($40.00)
opensourcealchemist ($100.00)
- $292.00 have been anonymously funded.
Submitted pull Requests
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 24
- Comments: 36 (8 by maintainers)
Commits related to this issue
- Support starting wee-slack without using rtm.start rtm.start is deprecated and will stop working on September 20, 2022. This patch replaces it with several other API endpoints to get the info we need... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying cookies in SlackRequest This is a necessary step for #844 — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying an auth cookie in slack_api_token This is necessary for xoxc tokens. The cookie is specified after the token with a colon separating them, i.e. "token1,token2:cookiefor2,token3". ... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support starting wee-slack without using rtm.start rtm.start is deprecated and will stop working on September 20, 2022. This patch replaces it with several other API endpoints to get the info we need... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying cookies in SlackRequest This is a necessary step for #844 — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying an auth cookie in slack_api_token This is necessary for xoxc tokens. The cookie is specified after the token with a colon separating them, i.e. "token1,token2:cookiefor2,token3". ... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support starting wee-slack without using rtm.start rtm.start is deprecated and will stop working on September 20, 2022. This patch replaces it with several other API endpoints to get the info we need... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying cookies in SlackRequest This is a necessary step for #844 — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying an auth cookie in slack_api_token This is necessary for xoxc tokens. The cookie is specified after the token with a colon separating them, i.e. "token1,token2:cookiefor2,token3". ... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support starting wee-slack without using rtm.start rtm.start is deprecated and will stop working on September 20, 2022. This patch replaces it with several other API endpoints to get the info we need... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying cookies in SlackRequest This is a necessary step for #844 — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying an auth cookie in slack_api_token This is necessary for xoxc tokens. The cookie is specified after the token with a colon separating them, i.e. "token1,token2:cookiefor2,token3". ... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support starting wee-slack without using rtm.start rtm.start is deprecated and will stop working on September 20, 2022. This patch replaces it with several other API endpoints to get the info we need... — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying cookies in SlackRequest This is a necessary step for #844 — committed to wee-slack/wee-slack by trygveaa 2 years ago
- Support specifying an auth cookie in slack_api_token This is necessary for xoxc tokens. The cookie is specified after the token with a colon separating them, i.e. "token1,token2:cookiefor2,token3". ... — committed to wee-slack/wee-slack by trygveaa 2 years ago
I’d be happy to chip in on a bounty for this one. I don’t have the time nor knowledge of the codebase nor slack protocol to contribute directly, but I’ll happily support anyone who does. Anyone with me? Using slack without wee-slack is severely slowing me down @ dayjob.
To get proper read status on threads, I moved to session tokens and just found that it’s a broken feature. While that’s the case, it’s probably best to remove the session tokens from documentation to avoid new users running into the issue.
Support for this has now been added in PR #857 (not merged yet). Please test it out and report any issues.
Hi all… Any workarounds we can use for now even if it’s complicated?
It’s a work around but not quite the workaround I think most of us need. I’m sure the biggest reason most of us here has to use the tokens is because we can’t get the slack org to install anything. Token access is usually the workaround for not being able to install apps. Which we can’t do to workaround the failing token auth.
Sorry I’ve been absent lately. I’ve now registered wee-slack on IssueHunt as requested above. I’ve also started working some work on this (can’t give any time frame though).
@Enqueued: If you can add the wee-slack app in your Slack team, you can use OAuth tokens as normal, they’re not affected by this. However, you can’t use OAuth tokens if you can’t add the app.
@megalithic can you set the project up on IssueHunt or a similar site so I can get this ball rolling?
I tested a bit, and saw that the
rtm.startAPI can’t be used with xoxc-tokens. So we need to rewrite to use other API endpoints to get the data we use fromrtm.start. Currentlyrtm.startis used to populate much of the initial info, i.e. the profile, users, bots, user groups, preferences (muted channels and highlight words) and list of channels and direct messages. So this might be a rather large task, which requires calling multiple other endpoints. The biggest issue is probably that wee-slack currently expects to be aware of all the users and channels on the team (whichrtm.startdoes return), while the new API endpoints only return a limited amount and are paginated to get more.After that is done, we can add support for specifying the
dcookie in addition to the token, which should be pretty easy. Though the currentslack_api_tokenis already a bit inconvenient, and would be even worse with a cookie as well, so we should probably change the config to have a section per team, like in the irc config.Fine with just
dcookie? https://github.com/yuya373/emacs-slack/issues/553 https://github.com/yuya373/emacs-slack/pull/552/commitsFinding a slack token & cookie: https://github.com/jackellenberger/emojme#finding-a-slack-token
Slack’s position on
xoxctokens: https://stackoverflow.com/a/62777057I tried to look at the request from the Slack web interface, and attempted to create a minimum request that connects to a websocket. It looked like this:
URL:
wss://wss-primary.slack.com/?token=xoxc-xxxxxx&gateway_server=<workspace_id>Cookie:d=ynd9q%2FWq...It would fail if any of the
token,gateway_serverordin Cookie is missing. Thedcookie’s expiry is 10 years.If we don’t fix this bug soon, it’s only going to get worse. I’ve now accepted that I can’t add any new workspaces to wee-slack, but my existing ones still work. But for how long? Every day that goes by, the risk increases that another workflow I rely on will go away.
https://cancel.fm/ripcord has a working authentication flow so it should be possible to use that cookie in conjunction with the xoxc token to authenticate again. It’ll probably require a PR to work with the new flow.
So apparently, the customize page now has a token starting with
xoxcinstead ofxoxs. These are two different types of tokens. After they changed toxoxcin the main app interface a long time ago, I feared they would change it on the customize page at some point too 😦Tokens starting with
xoxccan’t currently be used by wee-slack. I’m not sure how to get them to work, or if it is even possible for us to use them, but I guess I’ll have to look into it.