This is the OmniAuth stragegy for authenticaing to Open edX.
Note, this strategy only works with Open edX juniper
release or above.
Add to your Gemfile
:
gem "omniauth-open-edx"
- Go to
${LMS_URL}/admin/oauth2_provider/application
- Add a new application
- Enter redirect url, this depends on your setup, learn more from examples
- Select
Confidential
client type,Authorization code
authorization grant type - Get the
Client id
andClient secret
and configure them in your ruby application
use OmniAuth::Builder do
provider :open_edx,
ENV["OPEN_EDX_OAUTH_CLIENT_ID"],
ENV["OPEN_EDX_OAUTH_CLIENT_SECRET"],
{
scope: "profile email",
client_options: {
site: "https://courses.edx.org",
},
}
end