Versent / saml2aws

CLI tool which enables you to login and retrieve AWS temporary credentials using a SAML IDP
https://github.com/Versent/saml2aws
MIT License
2.07k stars 563 forks source link

Installing saml2aws for non-admin users on a Mac #1250

Closed annieco29 closed 3 months ago

annieco29 commented 5 months ago

I have 2 user accounts on a Mac that I use: One with Admin permissions and one without

I can install HomeBrew on the MAC and then install saml2aws using the Admin account but then I am not able to run saml2aws using my non admin account.

Script to install Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Installing this way the brew install saml2aws command is only available under Admin login

Do I need to use the terminal as admin or is there a way to install so I may use with my non admin account?

The window process talks about a .saml2aws file, is there a similar file into which connection credentials need to added on a MAC?

tinaboyce commented 5 months ago

Hi @annieco29,

There is a way to install saml2aws without homebrew. This instruction assumes you are using the Apple M1/M2/M3 chip series.

  1. In the terminal, run cd <directory> to a directory where you want saml2aws binary to be located. Please note some directories does require admin privilege. For the sake of an example, I will use ~/bin since it doesn't require admin privilege.
  2. Copy everything in the code block below, paste in the terminal and hit enter.

For Macbook Apple Chip (M1/M2/M3 CPU series)

CURRENT_VERSION=$(curl -Ls https://api.github.com/repos/Versent/saml2aws/releases/latest | grep 'tag_name' | cut -d'v' -f2 | cut -d'"' -f1)
DOWNLOAD_URL=https://github.com/Versent/saml2aws/releases/download/v${CURRENT_VERSION}/saml2aws_${CURRENT_VERSION}_darwin_arm64.tar.gz
curl -OL $DOWNLOAD_URL
tar -xzvf saml2aws_${CURRENT_VERSION}_darwin_arm64.tar.gz
./saml2aws --version

For Macbook Intel Chip If you are using this instead, let me know and I can see if I could source an older Mac to write up a script for this.

  1. The last output should be the current version of saml2aws, which at the time of writing is 2.36.15
  2. Open ~/.zshrc in your text editor of choice
  3. Add the following line in the ~/.zshrc file (this assumes using the example directory ~/bin
    export PATH="$PATH:$HOME/bin"
  4. Save the file
  5. In the terminal, type source ~/.zshrc
  6. Run saml2aws --version. If you see a version number as output (at time of writing, 2.36.15) , you are done!
tinaboyce commented 4 months ago

Hi @annieco29 ,

Just to follow up, are you still experiencing any issue trying to run saml2aws as non-admin?