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 SSO Profiles #19

Open
2 tasks
naftulikay opened this issue Dec 27, 2021 · 0 comments
Open
2 tasks

Support SSO Profiles #19

naftulikay opened this issue Dec 27, 2021 · 0 comments

Comments

@naftulikay
Copy link
Owner

AWS Single-Sign-On uses temporary credentials1, then uses STS to get temporary role credentials2.

naftulikay/aws-sso-env already implements the required logic to generate and export role credentials2, provided that the temporary credentials1 are present and not expired.

Temporary credentials1 are obtained via aws sso login, which opens a browser window to obtain the credentials. Config for SSO is typically stored in ~/.aws/config either as the default profile, or with INI header names like [profile prod]. Rather than storing the access key id and secret access key, the sections look like this:

[profile prod]
sso_start_url = https://$SOMETHING.awsapps.com/start
sso_region = us-east-1
sso_account_id = $ACCOUNT_ID
sso_role_name = $ROLE_NAME
region = us-east-1

Temporary credentials1 are stored in ~/.aws/sso/cache/$(shasum $SSO_START_URL).json and look like this:

{
  "accessToken": "...",
  "expiresAt": "2021-12-27T20:30:02+0000",
  "region": "us-east-1",
  "startUrl": "SSO_START_URL"
}

Using these credentials, role credentials2 can be obtained, and then access is permitted. What is not clear at the moment is the exact logic that aws sso login uses to do the login with the browser window. If this can be determined, then aws-env can do the full lifecycle login, if not, we can only do work if valid, unexpired cached SSO credentials exist.

  • Support role credentials generation from cached SSO credentials.
  • Support aws sso login functionality to generate temporary credentials1.
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

No branches or pull requests

1 participant