Python Script for updating the local credentials file in your computer using the SSO Login. This script creates a [account-role] entry in your credentials file. Each time you run the script it will update each file but not overwrite it.
- Latest Version of the AWS Cli
- Boto 1.13.19 or grater
- Python lib SafeConfigParser
- Python lib pathlib
Before running the script its important to update the settings file.
-
In SSO_START_URL setting replace the
[YOUR_COMPANY]
value with the corresponding. -
You can to update the default region too.
- Run
python3 get-creds.py
- It will take you to the SSO login page.
- Enter your credentials.
- When asked to back to the terminal and press enter.
- And that's it! :)
boto3
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sso-oidc.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sso.html
AWS
https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html
https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_RegisterClient.html
https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html
Facundo Pereyra / [email protected]
Matias Carosso / [email protected]