Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby Libraries for LaunchKey.
Ruby
branch: master

README.md

LaunchKey Ruby Build Status Gem Version

Overview

LaunchKey is an identity and access management platform This SDK enables developers to quickly integrate the LaunchKey platform and Ruby based applications without the need to directly interact with the platform API.

Developer documentation for using the LaunchKey API is found here.

An overview of the LaunchKey platform can be found here.

Pre-Requisites

Utilization of the LaunchKey SDK requires the following items:

  • LaunchKey Account - The LaunchKey Mobile App is required to set up a new account and access the LaunchKey Dashboard.

  • An application - A new application can be created in the LaunchKey Dashboard. From the application, you will need the following items found in the keys section of the application details:

    • The app key
    • The secret key
    • The private key

Installation

Add this line to your application's Gemfile:

gem 'launchkey'

And then execute:

$ bundle

Or install it yourself as:

$ gem install launchkey

Configuration

Run the Rails generator:

$ rails g launchkey:install

Or if using a different framework:

require 'launchkey'

LaunchKey.configure do |config|
  config.app_key     = 1234567890
  config.secret_key  = 'abcdefghijklmnopqrstuvwyz'
  config.keypair     = File.read('path/to/rsa-keypair.pem')
  config.passphrase  = 'private key passphrase'
end

Usage

Authorization

Make an authorization request with the user's LaunchKey username:

auth_request = LaunchKey.authorize('johnwayne')
# => "71xmyusohv0171fg..."

The returned string is needed for continuing as well as terminating the authorization. After the authorization request is made, the user is responsible for either accepting or rejecting the authorization. To continue the process, you must poll until a Hash containing the final auth payload is returned:

auth_response = LaunchKey.poll_request(auth_request)
# => { "message": "Pending response", ... }

auth_response = LaunchKey.poll_request(auth_request)
# => { "auth" => "...", "user_hash": "..." }

Check if the client accepted or rejected the authorization request:

LaunchKey.authorized?(auth_response['auth'])
# => true

Deauthorization

LaunchKey.deauthorize(auth_request)
# => true

Create white label user

LaunchKey.create_whitelabel_user(identifier)
# => { "lk_identifier" => "...", "qrcode" => "...", "code" => "... }

Support

GitHub

Submit feature requests and bugs on GitHub.

Twitter

Submit a question to the Twitter Handle @LaunchKeyHelp.

IRC

Engage the LaunchKey team in the #launchkey chat room on freenode.

LaunchKey Help Desk

Browse FAQ's or submit a question to the LaunchKey support team for both technical and non-technical issues. Visit the LaunchKey Help Desk here.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Something went wrong with that request. Please try again.