OmniAuth Khan Academy
This is an OmniAuth 1.0 strategy for authenticating to Khan Academy.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install omniauth-khan-academy
Register[http://www.khanacademy.org/api-apps/register] your app at Khan Academy 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/khan_academy" to try it out.
The default callback is routed to "*/auth/khan_academy/callback" but you can override it as shown:
provider :khan_academy, CONSUMER_TOKEN, CONSUMER_SECRET, callback_url: "my_callback_url"
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request