Use lpass
the lastpass cli tool with Okta SSO!
pre-built binaries which should be working for mac users:
Download lpass-sso-...-mac.zip from https://github.com/jnewbigin/lpass-sso/releases
Open a terminal
sudo ditto -xk --sequesterRsrc ~/Downloads/lpass-sso-...-mac.zip /Applications/lpass-sso
sudo mv Applications/lpass-sso/lpass-sso.app Applications/lpass-sso.app
export LPASS_PINENTRY=/Applications/lpass-sso.app/Contents/pinentry
Download lpass-mac from https://github.com/jnewbigin/lastpass-cli/releases/
chmod a+x ~/Downloads/lpass-mac
sudo cp ~/Downloads/lpass-mac /usr/local/bin/lpass
Run Applications/lpass-sso/lpass-sso.app Applications/lpass-sso.app
If not prompted, then you are OK to close the window and continue
Note: The first time you use lpass login --sso ...
you may be prompted to login twice. This seems to be related to the Security & Privacy settings
install the package for your platform (see below)
export LPASS_PINENTRY=/opt/lpass-sso/pinentry
lpass login --sso <your email address>
Complete the login via Okta in the web browser
Your session will be valid for one hour.
Configure with the LPASS_AGENT_TIMEOUT
environment variable (seconds)
These installation steps have been tested on macOS Catalina (10.15).
NOTE: I am in no way associated with LastPass. These instructions got me up and running with the new SSO modifications, but these docs may need some updates to adhere to LastPass’ best practices and workflow.
Navigate to the lpass-sso/lpass-sso/
directory.
npm install
npm start
Test the installation by entering your email address and you should be redirected to the Okta login.
NOTE: If you receive a “400 Bad Request” error, try closing the window and restarting the login process. It should work the second time.
brew update
brew install cmake pkgconfig
sudo make
sudo make install
NOTE: due to SIP on macOS, you may have trouble writing to the default path
make install
tries to install lpass to. To get around this I used the directory/usr/local/
instead. Use this command if you get an error about permissions:cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local
.
If everything worked correctly, you should now be able to use the command lpass login --sso email_address@whatever.com
to authenticate to the CLI.
If you run into any issues, the GitHub Issues page has a lot of good info on previous/current problems, but you can also contact LastPass support by opening a ticket: How do I contact customer support for LastPass? - LastPass Support
Outputs:
In this mode, the code will be validated but readable from any stack traces etc.
npm run-script start
npm run-script start-electron
In this mode, the code will be minified and not suitable for debugging
auto/lint
auto/dev-environment npm run-script build
npx electron .
In this mode, an install package will be created for various platofrms
auto/build