Jumpstarter is the AppStore for the web.
This is the basic implementation of their current 'magic sign-in button' in Ruby.
Please note, that Ruby isn't supported yet by Jumpstarter, so apps written in Ruby will be rejected currently. It's intended as a little push in the direction of supporting Ruby natively. If so, this project might help.
Add this line to your application's Gemfile:
gem 'jumpstarter-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jumpstarter-api
Please make sure, that you changed the important values in spec/fixtures/env.json
.
For proper testing you also need to follow this guideline, copy & paste the token to spec/jumpstarter_api_spec.rb
require 'jumpstarter/api'
js_env = Jumpstarter::Api::JumpstarterEnv.new # In production /app/env.json is consumed
js_env = Jumpstarter::Api::JumpstarterEnv.new(json) # Pass in json for testing purposes (see: spec/fixtures/env.json)
# If token validates, sign-in the user - yep, it's that easy!
token = params['jumpstarter-auth-token']
if js_env.validate_session(token)
# ... authenticated
end
- Fork it ( https://github.com/[my-github-username]/jumpstarter-api/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request