Skip to content

Commit

Permalink
Merge pull request #296 from openedx/ashultz0/lms-altbase
Browse files Browse the repository at this point in the history
feat: add override for the LMS_BASE_URL in various LTI settings
  • Loading branch information
ashultz0 authored Oct 26, 2022
2 parents af8bcdb + 415156c commit 0187b1b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lti_consumer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ def _(text):
def get_lms_base():
"""
Returns LMS base url to be used as issuer on OAuth2 flows
and in various LTI URLs. For local testing it is often necessary
to override the normal LMS base with a proxy such as ngrok, use
the setting LTI_LMS_BASE_URL_OVERRIDE in your LMS settings if
necessary.
TODO: This needs to be improved and account for Open edX sites and
organizations.
One possible improvement is to use `contentstore.get_lms_link_for_item`
and strip the base domain name.
"""
return settings.LMS_ROOT_URL
if hasattr(settings, 'LTI_LMS_BASE_URL_OVERRIDE'):
return settings.LTI_LMS_BASE_URL_OVERRIDE
else:
return settings.LMS_ROOT_URL


def get_lms_lti_keyset_link(config_id):
Expand Down

0 comments on commit 0187b1b

Please sign in to comment.