-
Install 1Password CLI and jq.
brew install jq brew cask install 1password-cli
-
Sign in to 1Password for the first time:
op signin my.1password.com [email protected] AA-AAAAAA-AAAAAA-AAAAA-AAAAA-AAAAA-AAAAA
This will save your secret key to
~/.op/config
. In the future you only need to type your 1Pass password. -
Add these functions to your shell profile. It assumes you have an entry in 1Password titled "Okta".
function 1pass-signin() { eval $(op signin my) } function okta-password() { op get item Okta | jq -r '.details.fields[] | select(.designation == "password").value' } function okta-secret() { op get item Okta | jq '.details.sections[1].fields[0].v' | awk -F'[=&]' '{print $2}' } function cclokta() { if [[ $# -eq 0 ]] ; then echo 'Usage: cclokta <profile>' return 1 fi profile="$1" 1pass-signin okta_password="$(okta-password)" okta_onetimepassword_secret="$(okta-secret)" clokta --profile "$profile" }
-
Refresh your shell and run
cclokta bigdata
.
Created
December 20, 2018 17:01
-
-
Save AlJohri/7e166db4d25959d8be2feb45a991a2f6 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment