ruimarinho / gsts

Obtain and store AWS STS credentials to interact with Amazon services by authenticating via G Suite SAML.
MIT License
219 stars 38 forks source link

chromium window closes after google 2fa has succeeded, before creds fetched #52

Closed lizthegrey closed 2 years ago

lizthegrey commented 2 years ago
ℹ Request to "https://signaler-pa.googleapis.com/punctual/multi-watch/channel?gsessionid=[snip]&key=[snip]&VER=8&RID=rpc&SID=[snip]&CI=0&AID=0&TYPE=xmlhttp&zx=[snip]&t=1" has failed
ℹ Aborted due to client request
ℹ An unknown error has ocurred while authenticating in headful mode page.waitForResponse: Page closed
=========================== logs ===========================
waiting for response "https://signin.aws.amazon.com/saml"
============================================================
    at /Users/cdueltgen/.volta/tools/image/packages/gsts/lib/node_modules/gsts/index.js:385:18
ℹ Headful instance has exited with code 1

cc @cdueltgen who experienced this problem

Big Sur 11.6.1, gsts 3.0.7

ruimarinho commented 2 years ago

Interesting. This block should have let that request continue instead of hitting https://github.com/ruimarinho/gsts/blob/master/index.js#L323.

Can you share what type of 2FA was used? Google Prompt / Security Key / SMS / other.

lizthegrey commented 2 years ago

Google Prompt.

sayoun commented 2 years ago

I've got the same issue, rollbacking to previous 3.0.6 version worked

mmadhur-cops commented 2 years ago

It works on 3.0.7 too just use below 2 flags along with the command

--aws-profile default --engine firefox

ruimarinho commented 2 years ago

Could you please v4.0.0 a try and see if the issue still persists? @mmadhur-cops that suggests it's something Chromium related, but unfortunately changing the engine is not an option for everyone.

ruimarinho commented 2 years ago

After a few more hours of debugging, I've found that the SetSID request which sets the session on Google's SSO servers is not receiving a response. This seems to be a deliberate option by Google, perhaps an attempt at detecting bots and making sure they hang.

The only automated work around so far is switching to a new engine as also suggested by @mmadhur-cops. Interestingly, copying the SetSID URL and opening it into a new browser tab also works, even in Chromium. I've tried automating this step but so far I can't get their server to reply.

ruimarinho commented 2 years ago

playwright@1.17 is out and with it a potential fix for the issue gsts users have been facing.

I can no longer replicate this problem. Could you please give v4.0.1 a try? Thanks!