Earnest-Labs / aws-sts

Generation of AWS STS tokens via SAML authentication.
67 stars 18 forks source link

Guidance Needed: Turning on debug mode #16

Open brianwallace opened 6 years ago

brianwallace commented 6 years ago

Very cool tool!

I believe I have all the required parameters set correctly, but authentication to Okta is timing out. I am trying to turn on headless browsing to debug, but I do not understand the directions on how to do this via the docker container.

Instructions state the following:

$ npm run start-debug

Where is this set?

ghost commented 6 years ago

I'm also getting this timeout.

./aws-token.example.sh
Earnest AWS Token Generator

? Okta username (ex. user@domain.com): me@domain.com
? Okta password: ********************************
  ◠ Logging in....wait() timed out after 30000msec
Error: .wait() timed out after 30000msec
    at null._onTimeout (/usr/src/app/node_modules/nightmare/lib/actions.js:453:10)
    at Timer.listOnTimeout (timers.js:92:15)
mjacksonest commented 5 years ago

I have timeout error as well, and got debug working.

You run npm run start-debug after cloning this repo and installing dependencies (assuming you have node, npm and chrome installed).

When running debug locally, you get to see what is happening in browser, in my case there was this error in the browser:

Sorry, you can't access Amazon Web Services because you are not assigned this app in Okta.

It then attempts to create a screen shot but I always got the error ENOENT: no such file or directory, open '/.../.debug/error.png'but that didn't matter since I could see page in browser while waiting for timeout.

mjacksonest commented 5 years ago

I found how to debug against docker container as well:

docker run -it --rm -e DEBUG=true -v $PWD:/usr/src/app/.debug -v $HOME/.aws/:/root/.aws/  ${ORG}/aws-sts --username me@somewhere.com

The unique parts for debug are -e DEBUG=true -v $PWD:/usr/src/app/.debug. This addition sets the DEBUG environment variable as well as mounts the missing .debug folder to dump out html(and supporting files) with error message into working directory.