From a1578db77ac518d9050193f1a718919d054b81d4 Mon Sep 17 00:00:00 2001 From: Jesus Federico Date: Thu, 2 May 2024 17:01:32 -0400 Subject: [PATCH] LTI-364: add a way to customise title and description on registration (#236) --- .../concerns/dynamic_registration_service.rb | 11 ++++------- app/views/message/deep_link.html.erb | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/controllers/concerns/dynamic_registration_service.rb b/app/controllers/concerns/dynamic_registration_service.rb index c17311da..86486d2e 100644 --- a/app/controllers/concerns/dynamic_registration_service.rb +++ b/app/controllers/concerns/dynamic_registration_service.rb @@ -28,12 +28,9 @@ def client_registration_request_header(token) end def client_registration_request_body(key_token) - params[:app] ||= params[:custom_broker_app] || Rails.configuration.default_tool - return if params[:app] == 'default' || params[:custom_broker_app] == 'default' - jwks_uri = registration_pub_keyset_url(key_token: key_token) - tool = Rails.configuration.default_tool + tool = params[:app] || Rails.configuration.default_tool { "application_type": 'web', @@ -43,9 +40,9 @@ def client_registration_request_body(key_token) "redirect_uris": [openid_launch_url(protocol: 'https'), deep_link_request_launch_url(protocol: 'https'),], - "client_name": t("apps.#{tool}.title"), + "client_name": params[:app_name] || t("apps.#{tool}.title"), "jwks_uri": jwks_uri, - "logo_uri": secure_url(lti_app_icon_url(params[:app])), + "logo_uri": params[:app_icon_url] || secure_url(lti_app_icon_url(tool)), # "policy_uri": 'https://client.example.org/privacy', # "policy_uri#ja": 'https://client.example.org/privacy?lang=ja', # "tos_uri": 'https://client.example.org/tos', @@ -55,7 +52,7 @@ def client_registration_request_body(key_token) "scope": 'https://purl.imsglobal.org/spec/lti-ags/scope/score https://purl.imsglobal.org/spec/lti-nrps/scope/contextmembership.readonly', "https://purl.imsglobal.org/spec/lti-tool-configuration": { "domain": URI.parse(openid_launch_url(protocol: 'https')).host, - "description": t("apps.#{tool}.description"), + "description": params[:app_description] || t("apps.#{tool}.description"), "target_link_uri": openid_launch_url(protocol: 'https'), "custom_parameters": {}, "claims": %w[iss sub name given_name family_name email], diff --git a/app/views/message/deep_link.html.erb b/app/views/message/deep_link.html.erb index 1d752d2a..f8631dea 100644 --- a/app/views/message/deep_link.html.erb +++ b/app/views/message/deep_link.html.erb @@ -26,7 +26,7 @@ with BigBlueButton; if not, see . %>
<%= image_tag(lti_app_icon_url(app[:app_name]), alt: "Icon", size: "35", class: "img-fluid") %>
-
<%= app[:app_name] %>
+
<%= app[:app_name].capitalize %>