• Recent blogs

    AWS: How do I access to the API or AWS CLI with AD FS?

     If you wanted to know how to access AWS with Active Directory Federation Services (ADFS)  then you are in the right place. For this setup to work we need to follow these steps. 

    1. Set up Multi-Factor Authentication and made sure your Duo settings default to “Duo Push” or “Call Me”.
    a. Click On Settings.
    Auth prompt duo settings

    b. Click on My Settings to add a method.

    c. Choose the following option here.
    DUO Choose a Option

    2. Keep your ADFS Id ready.
    3. Install the AWS CLI on your workstation.

    4. Now install the aws-adfs tool.

    $ python3 -m pip install --upgrade --user pipx 
    MAC Homebrew users can install with `brew install pipx`
    pipx install

    $ pipx ensurepath $ pipx install aws-adfs

    Alternatively, follow the directions on the aws-adfs GitHub project page to install system-wide or in a virtualenv.

    5. Now Authenticate.

    bash-3.2$ aws-adfs login --adfs-host=<ADFS Host FQDN> --ssl-verification --no-sspi --profile <profile name>

    When prompted, enter your ADFS ID  and enter your password. If prompted to choose a role, enter the number of the role you wish to use.

    You can now use the AWS CLI as that role.

    No comments