Open eschwartz opened 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
/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)"
}
I want to be able to authenticate as a DCE user (not admin), via an external IDP.
User Flow:
CLI command initiates auth flow
CLI grabs location of DCE API from dce.yml
dce system deploy
, or manually configured by end userCLI opens browser window at
https://<dce_api_url>/auth
/auth
uses Cognito JS SDK (client-side) to redirect user to IDP login page*IDP prompts user for username/password
IDP redirects back to
/auth
endpoint, with?code=
query param/auth
endpoint converts the?code=
param to a JWT, using Cognito JS SDK**/auth
endpoint converts the JWT to an STS token, using the Cognito JS SDK**/auth
endpoint encodes the STS token as base64/auth
endpoint displays base64 token to user, and copies to clipboardUser pastes the token back into their CLI prompt
CLI saves the token to
dce.yaml
for future useFor 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 eventsBONUS 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 rundce auth
and then alsodce leases login
.Tasks
For github.com/Optum/dce:
For github.com/Optum/dce-cli
dce auth
to open/auth
endpointdce auth
command prompts for code, and saves to dce.ymldce auth
for other CLI commands