Skip to content
LastPass Ruby API
Branch: master
Clone or download
Latest commit 3212ff1 Apr 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example Show use of device id in the example (closes #7) Jan 26, 2015
lib
spec Pretend to be a CLI client rather than a mobile device, this should p… Apr 23, 2018
.gitignore Use Bundler rake tasks to just 'rake build' or 'rake release' next time Jan 29, 2015
.travis.yml Don't support 1.9.3 anymore, some gems fail to install Feb 5, 2017
CHANGELOG.md Version bumped to 1.5.0 Feb 5, 2017
Gemfile Gemspec Dec 8, 2013
LICENSE License file Dec 4, 2013
Makefile Less hacky hack Dec 9, 2013
README.md Mention Python port in Readme Oct 14, 2016
Rakefile Use Bundler rake tasks to just 'rake build' or 'rake release' next time Jan 29, 2015
TODO TODO Feb 26, 2014
lastpass.gemspec Fix gem build warnings Feb 5, 2017

README.md

LastPass Ruby API

Build Status Coverage Status Code Climate Dependency Status

This is unofficial LastPass API.

There are also a C#/.NET port and a Python port available.

This library implements fetching and parsing of LastPass data. The library is still in the proof of concept stage and doesn't support all LastPass features yet. Only account information (logins, passwords, urls, etc.) is available so far.

There is a low level API which is used to fetch the data from the LastPass server and parse it. Normally this is not the one you would want to use. What you want is the Vault class which hides all the complexity and exposes all the accounts already parsed, decrypted and ready to use. See the example program for detail.

A quick example of accessing your account information:

require "lastpass.rb"

vault = LastPass::Vault.open_remote "username", "password"
vault.accounts.each do |i|
    puts "#{i.name}: #{i.username}, #{i.password} (#{i.url})"
end

A multifactor password (YubiKey, Google Authenticator) can optionally be appended to the login credentials:

vault = LastPass::Vault.open_remote "username", "password", "multifactor_password"

The blob received from LastPass could be safely stored locally (it's well encrypted) and reused later on.

LostPass iOS App

There's an iOS app called LostPass that is based on a totally incomplete C++ port of this library. If you are a LastPass user it would have made your life much easier if I didn't have to take it down from the App Store. Now it's open source and if you have a developer account or a jailbroken phone you could build it and install it on the phone. The source code is here.

Contributing

Contribution in any form and shape is very welcome. Have comments, suggestions, patches, pull requests? All of the above are welcome.

Thanks

License

The library is released under the MIT license.

You can’t perform that action at this time.