Skip to content

Commit

Permalink
LTI-364: add a way to customise title and description on registration (
Browse files Browse the repository at this point in the history
  • Loading branch information
jfederico authored May 2, 2024
1 parent 91c7014 commit a1578db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions app/controllers/concerns/dynamic_registration_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion app/views/message/deep_link.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>. %>
<div class="tool-logo-background">
<%= image_tag(lti_app_icon_url(app[:app_name]), alt: "Icon", size: "35", class: "img-fluid") %>
</div>
<h5 class="card-title mt-3"><%= app[:app_name] %></h5>
<h5 class="card-title mt-3"><%= app[:app_name].capitalize %></h5>

<!-- Info icon -->
<a class="info-icon mt-3"
Expand Down

0 comments on commit a1578db

Please sign in to comment.