This example is outdated.
The omniauth-slc gem was renamed to omniauth-inbloom.
Shared Learning Collaborative integration in a Rails App
This is an exmaple of how to use the omniauth-slc gem to authenticate with SLC API, and then use the HTTParty gem to make request to the API.
To set up a sandbox enviroment for SLC, follow this guide: dev.slcedu.org/getting-started/creating-sandbox-account
It uses some of the strategies in Ryan Bate's Railscast #241 Simple OmniAuth: railscasts.com/episodes/241-simple-omniauth.
To use this app you will need to export environment variables
export SLC_SANDBOX_KEY=YOUR KEY export SLC_SANDBOX_SECRET=YOUR SECRET
When you create an application as described in “registering your application” at dev.slcedu.org/getting-started/creating-sandbox-account
set your application location to:
set your callback url to:
This was done quickly and is not perfect. If you notice a bug, please submit an issue, or even better, fix it and submit a Pull Request.
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