Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 3.62 KB

login-manual.rst

File metadata and controls

110 lines (80 loc) · 3.62 KB

Manual Authentication

[Index]

Getting the authentication data

  1. Open up your Slack in your browser and login.

TOKEN

  1. Open your browser's Developer Console.

    1. In Firefox, under Tools -> Browser Tools -> Web Developer tools in the menu bar
    2. In Chrome, click the 'three dots' button to the right of the URL Bar, then select 'More Tools -> Developer Tools'
  2. Switch to the console tab.

  3. Paste the following snippet and press ENTER to execute:

    JSON.parse(localStorage.localConfig_v2).teams[document.location.pathname.match(/^\/client\/([A-Z0-9]+)/)[1]].token
    
  4. Token value is printed right after the executed command (it starts with "xoxc-"), save it somewhere for now.

Note

if you're having problems running the code snippet above, you can get the token the conventional way, see Troubleshooting section below.

COOKIE

OPTION I: Getting the cookie value

  1. Switch to Application tab and select Cookies in the left navigation pane.
  2. Find the cookie with the name "d". That's right, just the letter "d".
  3. Double-click the Value of this cookie.
  4. Press Ctrl+C or Cmd+C to copy it's value to clipboard.
  5. Save it for later.

OPTION II: Saving cookies to a cookies.txt

  1. Install the Get cookies.txt Chrome extension
  2. With your Slack workspace tab opened, press the "Get Cookies.txt" extension button
  3. Press Export button.
  4. The slack.com_cookies.txt will have been saved to your Downloads directory.
  5. Copy it to any convenient location, i.e. the directory where "slackdump" executable is.

Generally, there's no necessity in using the cookies.txt file, so providing d= cookie value will work in most cases.

It may only be necessary, if your slack workspace uses Single Sign-On (SSO) in case you keep getting invalid_auth error.

Slackdump will automatically detect if the filename is used as a value of a cookie, and will load all cookies from that file.

Setting up the application

  1. Create the file named .env next to where the slackdump executable in any text editor. Alternatively the file can be named secrets.txt or .env.txt.

  2. Add the token and cookie values to it. End result should look like this:

    SLACK_TOKEN=xoxc-<...elided...>
    COOKIE=xoxd-<...elided...>
    

    Alternatively, if you saved the cookies to the file, it will look like this:

    SLACK_TOKEN=xoxc-<...elided...>
    COOKIE=path/to/slack.com_cookies.txt
    
  3. Save the file and close the editor.

Troubleshooting

Getting token the hard way

  1. Open your browser's Developer Console, as described in the TOKEN section steps above.
  2. Go to the Network tab
  3. In the toolbar, switch to Fetch/XHR view.
  4. Open any channel or private conversation in Slack. You'll see a bunch of stuff appearing in Network panel.
  5. In the list of requests, find the one starting with channels.prefs.get?, click it and click on Headers tab in the opened pane.
  6. Scroll down, until you see Form Data
  7. Grab the token: value (it starts with "xoxc-"), by right clicking the value and choosing "Copy Value".

If you don't see the token value in Google Chrome - switch to Payload tab, your token is waiting for you there.

[Index]