-
Notifications
You must be signed in to change notification settings - Fork 20
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
Authentication with Cognito #33
Comments
@joshmarsh is going to drive the github.com/Optum/dce work |
@eschwartz , here's an example of the sts creds JSON:
|
eschwartz
pushed a commit
that referenced
this issue
Nov 22, 2019
Stuff going on here - Add `dce auth` command - pops you out to a browser at the `/auth` endpoint that @joshmarsh is working on - see #33 - Remove dce.yml configs we aren't using - Configure a AWS creds provider that will load creds from the auth token, but fallback to env vars or the `~/.aws/credentials` file - Run `dce auth` before any command, if we don't have any valid creds in our chain - Refactor how to load and save our config YAML, so it's easier to work with from inside multiple commands - Remove viper dependency (wasn't really being used) - Some other cleanup/refactor around init logic, to get this all wired up properly - I'll try to point these out in the code - New setup for integration tests - These test call our cobra CLI programmatically. For some reasons: - Lets us use debugger to run through tests - Don't need to rebuild for every test run - Can still use mocks at boundaries (eg. mock out web browser call) - I'm hoping this new testing pattern makes it easier to write tests for CLI commands going forward.
eschwartz
pushed a commit
that referenced
this issue
Nov 22, 2019
Stuff going on here - Add `dce auth` command - pops you out to a browser at the `/auth` endpoint that @joshmarsh is working on - see #33 - Remove dce.yml configs we aren't using - Configure a AWS creds provider that will load creds from the auth token, but fallback to env vars or the `~/.aws/credentials` file - Run `dce auth` before any command, if we don't have any valid creds in our chain - Refactor how to load and save our config YAML, so it's easier to work with from inside multiple commands - Remove viper dependency (wasn't really being used) - Some other cleanup/refactor around init logic, to get this all wired up properly - I'll try to point these out in the code - New setup for integration tests - These test call our cobra CLI programmatically. For some reasons: - Lets us use debugger to run through tests - Don't need to rebuild for every test run - Can still use mocks at boundaries (eg. mock out web browser call) - I'm hoping this new testing pattern makes it easier to write tests for CLI commands going forward.
This was referenced Dec 5, 2019
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to be able to authenticate as a DCE user (not admin), via an external IDP.
User Flow:
dce system deploy
, or manually configured by end userhttps://<dce_api_url>/auth
/auth
uses Cognito JS SDK (client-side) to redirect user to IDP login page*/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 clipboarddce.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 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 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 commandsThe text was updated successfully, but these errors were encountered: