This project has been inspired from How to Implement a General Solution for Federated API/CLI Access Using SAML 2.0.
Note: the project has been tested with ADFS 3.0 configuration.
In you ~/.aws/credentials
, you need the following section (replace the region by yours):
[default]
output = json
region = us-east-1
aws_access_key_id =
aws_secret_access_key =
- Clone the repository and install it using the following command (Python3 and pip needed):
python setup.py install
- Install it using pip:
pip install git+git://github.com/jeremietharaud/aws-cli-saml-login.git
When you launch aws-cli-saml-login
, you will prompted the IDP entry url, your username and your password.
By default, the new access key pair is stored into a section named saml
on /.aws/credentials
file.
To store it in a specific profile, set the environment variable AWS_PROFILE
.
If you don't want to type the IDP url each time, create an environment variable named IDP_ENTRY_URL
.