Optum / dce-cli

Disposable Cloud Environment CLI
Apache License 2.0
38 stars 20 forks source link

Authentication with Cognito #33

Open eschwartz opened 4 years ago

eschwartz commented 4 years ago

I want to be able to authenticate as a DCE user (not admin), via an external IDP.

User Flow:

For future CLI commands...

Other Considerations


* note that /auth endpoint is not yet implemented. Will be completed in main DCE repo ** Alternatively, /auth endpoint could just grab the ?code= param and pass it back to the CLI, and the CLI could do the code->JWT->STS conversion *** ...or so we think. See /leases/auth code for inspecting cognito data in API GW events


BONUS POINTS: Auto-Auth

CLI should have a pre-command hook, which authenticates users if they aren't already authenticated.

So, I should be able to run dce leases login, go through my IDP login, and get access to my AWS account. (I don't want to run dce auth and then also dce leases login.

Tasks

For github.com/Optum/dce:

For github.com/Optum/dce-cli

eschwartz commented 4 years ago

@joshmarsh is going to drive the github.com/Optum/dce work @eschwartz is going to drive the github.com/Optum/dce-cli work

joshmarsh commented 4 years ago

/auth endpoint encodes the STS token as base64 /auth endpoint displays base64 token to user, and copies to clipboard

@eschwartz , here's an example of the sts creds JSON:

{
   "accessKeyId":"xxx",
   "secretAccessKey":"xxx",
   "sessionToken":"xxx",
   "expireTime":"Wed Nov 20 2019 13:30:13 GMT-0600 (Central Standard Time)"
}