Skip to content
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

Support for Nextstrain CLI's new means of authentication with IdPs #757

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

tsibley
Copy link
Member

@tsibley tsibley commented Nov 20, 2023

Nextstrain CLI will start using OIDC/OAuth2's authorization code flow to interact with not just AWS Cognito but other IdPs as well (i.e. as used in other deployments of nextstrain.org).

To support this without hardcoding or onerous user-side configuration, Nextstrain CLI will start using the standard OIDC configuration endpoint, /.well-known/openid-configuration, to auto-discover necessary configuration about both the IdP to talk to and the client it should be.

Related-to: https://github.com/nextstrain/private/issues/94

Related CLI PR: TKTK

Checklist

  • Checks pass
  • Apply Terraform changes to production environment in advance of deploy and update config.json

…son.gz

Based on changes @jameshadfield made in the AWS Console, but stripped
down to just the single object necessary by the current consuming code.

(Cherry-picked from d6198a4 so I can
temporarily deploy changes to testing for my branch without reverting
the changes in this commit.  I'd prefer to set up a separate
branch-specific Terraform config/environment, but that's not a workable
solution for this issue until IAM _users_ are also integrated into our
Terraform config.)
Expanding the information on each client will make this necessary.
Plus, it's more clear what's shared by both with that information now
outside of either section.
@@ -3,6 +3,7 @@
"OIDC_IDP_URL": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Cg5rcTged",
"OAUTH2_CLIENT_ID": "rki99ml8g2jb9sm1qcq9oi5n",
"OAUTH2_CLI_CLIENT_ID": "2vmc93kj4fiul8uv40uqge93m5",
"OAUTH2_CLI_CLIENT_REDIRECT_URIS": [],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be filled out before deploy, after applying Terraform updates to production.

@tsibley tsibley requested review from victorlin and a team November 20, 2023 09:01
@tsibley
Copy link
Member Author

tsibley commented Nov 20, 2023

To clarify something just discussed with Victor: this could get merged and deployed without affecting current Nextstrain CLI clients. The main changes are a new nextstrain.org server endpoint and additional allowed OAuth flows for the CLI's client registration with Cognito. Both are used by work-in-progress Nextstrain CLI changes TKTK, but both are additive and not impacting the current CLI auth flow.

@tsibley tsibley marked this pull request as ready for review November 20, 2023 23:54
@tsibley
Copy link
Member Author

tsibley commented Nov 21, 2023

@victorlin @jameshadfield Thoughts on if I should just deploy 1019326 with this branch? Or drop it and leave it for #719?

@tsibley
Copy link
Member Author

tsibley commented Nov 21, 2023

(I'm inclined to just deploy it since it's read-only and public data.)

@victorlin
Copy link
Member

Seems fine to me, it'll make the dev process easier.

Nextstrain CLI will start using OIDC/OAuth2's authorization code flow to
interact with not just AWS Cognito but other IdPs as well (i.e. as used
in other deployments of nextstrain.org).

To support this without hardcoding or onerous user-side configuration,
Nextstrain CLI will start using the standard OIDC configuration
endpoint, /.well-known/openid-configuration, to auto-discover necessary
configuration about both the IdP to talk to and the client it should be.

Terraform changes are deployed to both production and testing as they're
additive and will not impact current CLI auth flow.

Related-to: <nextstrain/private#94>
@tsibley tsibley merged commit f20eaf4 into master Nov 21, 2023
5 checks passed
@tsibley tsibley deleted the trs/cli/login branch November 21, 2023 19:45
@tsibley tsibley temporarily deployed to nextstrain-s-trs-cli-lo-zassjp November 21, 2023 19:45 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants