Login to AWS CLI using Active Directory Federation Services
python version >= 3.5
Git clone this repo, then execute
$ cd aws-cli-adfs
$ pip install .
or install with
pip install -U awscli-adfs
$ aws-adfs version
$ aws-adfs profile create
Example:
$ aws-adfs profile create
Profile Name: cn-prod
IDP Entry Url: https://login.your-ad-server.com/adfs/ls/idpInitiatedSignOn.aspx?loginToRp=urn:amazon:webservices:cn-north-1
IDP Username: [email protected]
IDP Role ARN: arn:aws-cn:iam::111111111111:role/ADFS-CNAdmin
IDP Session Duration(in seconds) [3600]:
AWS Region: cn-north-1
Output Format [json]:
Done.
$ aws-adfs profile ls
$ aws-adfs profile show PROFILE-NAME1 PROFILE-NAME2 ...
$ aws-adfs profile update PROFILE-NAME1 PROFILE-NAME2 ...
$ aws-adfs profile default PROFILE_NAME
Once the default profile is set, you don't have to specify PROFILE-NAME in 'show', 'update', 'delete', 'expire-at' subcomands and 'login' command
$ aws-adfs profile default
$ aws-adfs profile delete PROFILE-NAME1 PROFILE-NAME2 ...
$ aws-adfs login PROFILE-NAME1 PROFILE-NAME2 ...
$ aws-adfs profile expire-at PROFILE-NAME1 PROFILE-NAME2 ...
~/.aws/aws-adfs.log