Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to recognize successful login after 2FA Authentication #344

Open
lsy641 opened this issue Nov 2, 2024 · 16 comments
Open

Fail to recognize successful login after 2FA Authentication #344

lsy641 opened this issue Nov 2, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@lsy641
Copy link

lsy641 commented Nov 2, 2024

Describe the bug
Slackdump fails to recognize successful login that requires 2FA Authentication by university enterprise

Authentication type (please read)
My issue is related to login, the workspace uses SSO

To Reproduce
Steps to reproduce the behavior:

  1. Run slackdump like this 'go run .\cmd\slackdump\ export -enterprise https://app.slack.com/client/E029PC1PHFX -legacy-browser'
  2. Type workspace name: umich.enterprise
  3. Login by choosing Other/Manual
  4. A browser bounces out and asks me to login with the university account and password
  5. 2FA authentication via DUO Mobile app
  6. Successfully login the workspace and redirect the page to the workspace page.

Expected behavior
The command line interface should proceed the login process and start to "export"

Output
It keeps hanging at the line "export: ℹ️ Initialising browser, once the browser appears, login as usual"

Desktop (please complete the following information):

  • OS: [windows]
  • OS Version: [11]
  • Slackdump Version: [v3]

Additional context
Add any other context about the problem here.

@rusq
Copy link
Owner

rusq commented Nov 2, 2024

Could you try using Google at step 3, and let me know? If it doesn't work, could you try "-legacy-browser" flag as described: https://github.com/rusq/slackdump/wiki/EZ-Login-3000#using-playwright-instead-of-rod?

@rusq
Copy link
Owner

rusq commented Nov 3, 2024

If you pull the latest master, you can try selecting User Browser and then choosing the desired browser to login. If you're already logged in in that browser, and slack loads, press Ctrl+R to refresh, and then the token and cookies will be captured by Slackdump.

@rusq rusq closed this as completed Nov 5, 2024
@lsy641
Copy link
Author

lsy641 commented Nov 5, 2024

@rusq hi, how do you specify browser type? It always chooses edge explorer by default

@rusq
Copy link
Owner

rusq commented Nov 6, 2024

@lsy641
out

Hope this helps?

@wshanks
Copy link

wshanks commented Nov 25, 2024

For what it is worth, I have this same issue with 3.0.0-alpha. Using either the default interactive flow through Chromium or -legacy-browser -browser firefox with -enterprise, I log in and get to the workspaces page but the command line never proceeds past Initialising browser, once the browser appears, login as usual. I was trying slackdump workspace new rather than slackdump export (I thought I had to run that first based on #273).

@rusq rusq reopened this Nov 25, 2024
@rusq
Copy link
Owner

rusq commented Nov 25, 2024

-legacy-browser uses Playwright, which takes a while (more than a minute) to initialise, how long did you wait?

Playwright-go does 3 things behind the scenes -

  1. Installs nodejs
  2. downloads the playwright runtime
  3. Downloads the selected browser.

Problem is - it only starts showing the progress when it's downloading the browser, so I would retry and see if in couple of minutes if it works.

@wshanks
Copy link

wshanks commented Nov 25, 2024

Problem is - it only starts showing the progress when it's downloading the browser, so I would retry and see if in couple of minutes if it works.

Hmm, but with both the default Chromium flow and the playwright/firefox flow, I see the browser GUI and perform the enterprise SSO 2FA login. Isn't the waiting time you are referring to the set up of the browser, so before this time?

@rusq rusq added the bug Something isn't working label Nov 25, 2024
@rusq
Copy link
Owner

rusq commented Nov 25, 2024

Must have misread the initial post, so

  1. You see the browser;
  2. You do the login via SSO and it is successful.

Then what happens?

  1. Do you see the slack client in the browser? if not, what page do you see in the browser?
  2. What SSO provider are you using?

@yarikoptic
Copy link
Contributor

FWIW -- I am also similarly failing I think although I do not even have 2FA:

  • I did ./slackdump workspace new -enterprise -legacy-browser INSTANCE
  • it did open browser to login to that INSTANCE.enterprise.slack.com
  • I logged in via "I have a guest account", which lead me to username/password auth
  • slack opened "Workspace directory" page and gave me a choice between two slack workspaces on that instance
  • I chose one and clicked for it "Launch in slack"
  • slack opened another tab with that workspace where I could see all the messages etc

but in terminal I only see

❯ ./slackdump workspace new -enterprise -legacy-browser INSTANCE
2024/11/26 11:42:48 INFO Please wait while Playwright is initialising.
2024/11/26 11:42:48 INFO If you're running it for the first time, it will take a couple of minutes...

and if I close the browser or just that first initial tab which closes the browser (closing the specific one for the specific workspace - does not close browser):

2024/11/26 11:45:23 ERROR 004 (Authentication Error): failed to initialise the auth provider: browser closed or timed out.
./slackdump workspace new -enterprise -legacy-browser mit  28.62s user 4.49s system 21% cpu 2:34.86 total

@wshanks
Copy link

wshanks commented Nov 26, 2024

I see the same thing as @yarikoptic. I have access to two enterprise Slack instances (with the same auth method). One of them works fine. That one only has a single workspace. The other that I have problems with opens the workspace selection page after I log in with the browser that slackdump opens (either the new Chromium one or the legacy playwright/Firefox one). My guess is that slackdump doesn't know how to handle a Slack "workspace" that actually encompasses multiple workspaces? (Does Slack really not have separate terminology for the two kinds of "workspaces"?).

@rusq
Copy link
Owner

rusq commented Nov 27, 2024

@yarikoptic, oh, I see now, thanks for the detailed description.

Unfortunately it wouldn't work for another tab - the login automation doesn't track other tabs, just the one which it initially opens.

Could someone try the following:

  1. copying the address from the new tab;
  2. and paste it in the first tab and press enter;

Slackdump would be able to intercept the cookies then.

@rusq
Copy link
Owner

rusq commented Nov 27, 2024

Unfortunately I cannot test multiple workspace flow, as I don't have access to such an enterprise instance.

@rusq
Copy link
Owner

rusq commented Nov 27, 2024

Also, question - why do you use -legacy-browser? Is there some kind of problem that gets resolved when you're using it?

@wshanks
Copy link

wshanks commented Nov 27, 2024

Could someone try the following:

1. copying the address from the new tab;

2. and paste it in the first tab and press enter;

🚀 That worked for me, thanks! I don't know if it was the same for yarikoptic, but I only tried the legacy browser option in the hope that it would figure out the authentication after the default option did not seem to work.

I think this issue can be closed now though it would be good to document the solution.

@yarikoptic
Copy link
Contributor

I have pasted that https://app.slack.com/client/E01-SENSORED/CMG-SENSORED url into first tab - it did go to the same slack view, closed 2nd tab, nothing special happened :-/ I have even allowed "Enable notifications" while in the 2nd tab.
So unfortunately I need more "foo" here. What is the program waiting for to happen in that browser?

@rusq
Copy link
Owner

rusq commented Dec 15, 2024

Sorry for the long wait. During the login, after the user/password are entered correctly, slackdump (via slackauth) waits for the browser to send an "api.features" api call, and captures the token/cookie value from it. When you have Slack client open and logged in (you can see the channels and conversations) in that tab that Slackdump created, could you try refreshing it and see if that leads to the successful slackdump login?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants