OmniAuth KhanAcademy

This is an OmniAuth 1.0 strategy for authenticating to KhanAcademy.

Installation

Add this line to your application's Gemfile:

gem 'omniauth-khan-academy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omniauth-khan-academy

Usage

Register[http://www.khanacademy.org/api-apps/register] your app at KhanAcademy and get your consumer token and secret.

In a Rack application:

use OmniAuth::Builder do
  provider :khan_academy, CONSUMER_TOKEN, CONSUMER_SECRET
end

For Rails, put this in your omniauth configuration file:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :khan_academy, CONSUMER_TOKEN, CONSUMER_SECRET
end

Restart the server and visit "*/auth/khanacademy" to try it out.

The default callback is routed to "*/auth/khanacademy/callback" but you can override it as shown:

provider :khan_academy, CONSUMER_TOKEN, CONSUMER_SECRET, callback_url: "my_callback_url"

Author

Dipil Saud (@dipil-saud)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request