rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.6k stars 72 forks source link

Slack login not working because browser not supported in mac now #328

Closed abhishekgahlot2 closed 1 month ago

abhishekgahlot2 commented 1 month ago

Unable to login because slack is saying unable to login.

Latest release: 2.5.12. Chrome: 129.0.6668.90

abhishekgahlot2 commented 1 month ago

For some reason chromium was sending user agent to slack as 112 instead of 129 version.

I forked your repo to override the user agent for playwright go to make sure its working correctly for now I have made it work but looks like its some bug with chromium that it was still sending old user agent to slack and slack was saying its unsupported.

https://github.com/abhishekgahlot2/slackauth/blob/master/login_manual.go#L49

        page, err := browser.Page(proto.TargetCreateTarget{URL: wspURL})
    if err != nil {
        return "", nil, ErrBrowser{Err: err, FailedTo: "open page"}
    }
    // Set a custom User-Agent (Chrome 126.0.0.0)
    err = page.SetUserAgent(&proto.NetworkSetUserAgentOverride{
        UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
    })

I hope this helps others too, thanks!

conjon42 commented 1 month ago

I have the same issue on macbook. If I choose the manual login option, I can see the Chrome browser that runs, and in the options on that browser, it says chrome is up to date (version 129), but the slack website thinks I am on an old version, as it says this browser version is not supported as of Sept. 1 2024.

@abhishekgahlot2 As a beginner, I haven't figured out how to integrate the change you made in my own installation of slackdump, as I cannot tell where the slackdump program is connecting to slackauth.

rusq commented 1 month ago

Hey @abhishekgahlot2 thanks for raising this, will integrate the change into slackauth shortly, planning to use this string for MacOS, and alike for other OSes:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Will check if setting header

Sec-Ch-Ua: "Brave";v="129", "Not=A?Brand";v="8", "Chromium";v="129"

header affects anything too.

conjon42 commented 1 month ago

@dmi3-bu If you need a quick fix, go into the chrome browser that opens for a manual login option, go to the menu bar (three dots top right), scroll down to "more tools" -> Developer tools, in the dev tools menu, go to top right three dots specifically for developer tools (next to the gear), scroll down to "more tools" -> Network conditions. Under that interface in the console, find the User agent section, uncheck the use default box, and under the selection bar for user agent, select what makes sense for you, probably "Google chrome - Windows." Then refresh the slack page and proceed as normal.

mikedlr commented 1 month ago

same problem reproduced under Ubuntu 24.4

considine commented 1 month ago

Had the same problem on Ubuntu. @abhishekgahlot2's solution worked perfectly for me and I created a fork here: https://github.com/considine/slackdump

git clone https://github.com/considine/slackdump
cd slackdump
go build ./cmd/slackdump

Also I used @conjon42's which also worked.

Thanks guys

mikedlr commented 1 month ago

@considine When I tried your instructions and asked it to dump (Ubunt 24.04)

     thread_test.go     users.go

mikedlr@kinga:~/projects/slack-dlraf/slackdump_considine/slackdump$ ./slackdump

Slackdump unknown (commit: unknown) built on: unknown

panic: not implemented

goroutine 1 [running]: github.com/rusq/slackdump/v3/cmd/slackdump/internal/dump.WizDump({0x149a258?, 0xc0001b3560?}, 0xc00007a058?, {0xc00053fb28?, 0x0?, 0xc00048aa80?}) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/internal/dump/wizard.go:14 +0x25 github.com/rusq/slackdump/v3/cmd/slackdump/internal/wizard.runWizard.func1(0x1bee5a0?) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/internal/wizard/wizard.go:69 +0xb2 github.com/rusq/slackdump/v3/cmd/slackdump/internal/wizard.run(0xc0002a4000?, {0xc00047e030, 0x4}, 0xc0004c1c58) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/internal/wizard/wizard.go:164 +0xdc github.com/rusq/slackdump/v3/cmd/slackdump/internal/wizard.show(0xc0000a6000, 0xc0004c1c58) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/internal/wizard/wizard.go:132 +0xaf github.com/rusq/slackdump/v3/cmd/slackdump/internal/wizard.runWizard({0x149a258, 0xc000485080}, 0x109365d?, {0xc0005c4020, 0x0, 0x0}) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/internal/wizard/wizard.go:58 +0xe5 main.invoke(0x1bef020, {0xc0005c4020?, 0xb?, 0x1be6080?}) /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/main.go:209 +0x7ef main.main() /home/mikedlr/projects/slack-dlraf/slackdump_considine/slackdump/cmd/slackdump/main.go:126 +0x692

rusq commented 1 month ago

v2.5.13 is a quick fix for the issue, having only one user agent string. Regardless of OS it identifies as a MacOS Chrome. I'll keep this issue open till I do it properly.

Please post any issues in this thread.

@abhishekgahlot2 , @considine thank you for your investigation and help! 🤝

abhishekgahlot2 commented 1 month ago

Thanks folks. Glad this worked out and we released new version.

balazs300 commented 1 month ago

Same issue just happened to me testing the v2.5.14.

rusq commented 1 month ago

@balazs300 any messages/screenshots?

I.e.:

balazs300 commented 1 month ago

Hey, sorry, I forgot the important details.

rusq commented 1 month ago

@balazs300 thanks for detailed update, I tested and confirm this. Seems to be an upstream issue, as described in here: https://github.com/go-rod/rod/issues/1033.

For now, please use the email/password login. I'm going to close off this issue, and create a new one for the ROD/Google Auth from your message.

rusq commented 1 month ago

@balazs300 try v2.5.15, and select "Google". Make sure you close your browser before starting slackdump, otherwise it won't be able to connect to it.

image