Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/locales/server.en.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
en:
site_settings:
lti_consumer_enabled: "Enable LTI authentication"
lti_consumer_key: "LTI consumer key"
lti_consumer_secret: "LTI consumer secret"
lti_consumer_authenticate_url: 'EdX authentication URL (eg., course page with link to forums)'
2 changes: 2 additions & 0 deletions config/settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
plugins:
lti_consumer_enabled:
default: true
lti_consumer_key:
default: 'foo'
client: false
Expand Down
4 changes: 4 additions & 0 deletions lti_authenticator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def name
'lti'
end

def enabled?
SiteSetting.lti_consumer_enabled
end

# override hook
def register_middleware(omniauth)
log :info, 'register_middleware'
Expand Down
3 changes: 1 addition & 2 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Enable site settings in admin UI.
# See descriptions in files in the `config` folder.
enabled_site_setting :lti_consumer_enabled
enabled_site_setting :lti_consumer_key
enabled_site_setting :lti_consumer_secret
enabled_site_setting :lti_consumer_authenticate_url
Expand All @@ -25,9 +26,7 @@
require_relative 'lti_authenticator.rb'
auth_provider({
title: 'Click to login with EdX',
message: 'Click to login with EdX',
authenticator: LTIAuthenticator.new,
full_screen_login: true,
custom_url: '/lti/redirect_to_consumer'
})

Expand Down