cancel
Showing results for 
Search instead for 
Did you mean: 
jb3
Community Participant

Question about environments in LTI configuration

Here is the xml configuration I am using:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<blti:title>theTitle</blti:title>
<blti:description>theDescription</blti:description>
<blti:custom name="custom_fields">
<lticm:property name="canvas_account_id">$Canvas.account.id</lticm:property>
<lticm:property name="canvas_account_name">$Canvas.account.name</lticm:property>
<lticm:property name="canvas_account_sis_id">$Canvas.account.sisSourceId</lticm:property>
<lticm:property name="canvas_api_domain">$Canvas.api.domain</lticm:property>
<lticm:property name="canvas_shard_id">$Canvas.shard.id</lticm:property>
<lticm:property name="canvas_membership_roles">$Canvas.membership.roles</lticm:property>
<lticm:property name="canvas_root_account_id">$Canvas.root_account.id</lticm:property>
<lticm:property name="canvas_global_root_account_id">$Canvas.root_account.global_id</lticm:property>
<lticm:property name="canvas_user_id">$Canvas.user.id</lticm:property>
<lticm:property name="canvas_user_login_id">$Canvas.user.loginId</lticm:property>
<lticm:property name="canvas_masquerading_user_id">$Canvas.masqueradingUser.id</lticm:property>
<lticm:property name="canvas_masquerading_user_user_id">$Canvas.masqueradingUser.userId</lticm:property>
<lticm:property name="person_email_primary">$Person.email.primary</lticm:property>
<lticm:property name="person_name_full">$Person.name.full</lticm:property>
<lticm:property name="person_name_full">$Person.name.full</lticm:property>
<lticm:property name="person_sourced_id">$Person.sourcedId</lticm:property>
</blti:custom>
<blti:extensions platform="canvas.instructure.com">
<lticm:property name="tool_id">theToolID</lticm:property>
<lticm:property name="privacy_level">name_only</lticm:property>
<lticm:options name="global_navigation">
<lticm:property name="text">theMenuItemText</lticm:property>
<lticm:property name="url">theLaunchUrl</lticm:property>
<lticm:property name="icon_url">theIconUrl</lticm:property>
<lticm:property name="visibility">admins</lticm:property>
<lticm:property name="enabled">true</lticm:property>
<lticm:property name="oauth_compliant">true</lticm:property>
</lticm:options>
<lticm:options name="environments">
<lticm:property name="launch_url">TheTestLaunchUrl?</lticm:property>
<lticm:property name="domain">TheTestLaunchDomain?</lticm:property>
<lticm:property name="test_launch_url">TheTestLaunchUrl</lticm:property>
<lticm:property name="test_domain">TheTestLaunchDomain</lticm:property>
<lticm:property name="beta_launch_url">TheBetaLaunchUrl</lticm:property>
<lticm:property name="beta_domain">TheBetaDomain</lticm:property>
</lticm:options>
</blti:extensions>
<cartridge_bundle identifierref="BLTI001_Bundle"/>
<cartridge_icon identifierref="BLTI001_Icon"/>
</cartridge_basiclti_link>

In regards to the "environments" section of the configuration, it seems like the placement does not work unless the "url" property is set under the global_navigation option. It also seems like something is wrong with the way I am setting up the environments section because it still uses the production launch on the test server. The documentation shows the same url for launch_url and test_launch_url.

Question 1: Can someone provide a working example of the environments section?

Question 2: Is the "launch_url" of the environments section supposed to be production or test?

EDIT:

I think this post confirms that I am close to setting it up correctly. It also suggests that the environments setting is only used when pushing production down to test or beta so that is probably why I am not seeing it work yet.

Question 3: Is there a way to force updating test from production or do I have to wait 3 weeks to test this out?

0 Kudos
5 Replies
MattHanes
Community Champion

Question 3: You'll probably have to ask your CSM if that's possible but the beta updates every week so you could just wait until this weekend.

j_causby
Community Participant

Hi J B,

I just want to confirm that my conventional wisdom tells me to set the environments as this:

<lticm:options name="environments">
    <lticm:property name="launch_url">http://example.com/content</lticm:property>
    <lticm:property name="domain">example.com</lticm:property>
    <lticm:property name="test_launch_url">http://test.example.com/content</lticm:property>
    <lticm:property name="test_domain">test.example.com</lticm:property>
    <lticm:property name="beta_launch_url">http://beta.example.com/content</lticm:property>
    <lticm:property name="beta_domain">beta.example.com</lticm:property>
</lticm:options‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍>

where the launch_url and domain should be the 'live' version of the tool, and the test_launch_url and test_domain is the 'test' version of the tool, yet the official Test Environment Setting Examples documentation shows the launch_url/domain differently:

<lticm:options name="environments">
    <lticm:property name="launch_url">http://test.example.com/content</lticm:property>
    <lticm:property name="domain">test.example.com</lticm:property>
    <lticm:property name="test_launch_url">http://test.example.com/content</lticm:property>
    <lticm:property name="test_domain">test.example.com</lticm:property>
    <lticm:property name="beta_launch_url">http://beta.example.com/content</lticm:property>
    <lticm:property name="beta_domain">beta.example.com</lticm:property>
</lticm:options>

Should I be going with my conventional wisdom, or with what the documentation is suggesting?  Is this a bug in the documentation?

jb3
Community Participant

Did you get it working?

I am trying to figure this out again and this is what I recently tried but it did not work:

<lticm:options name="environments">
    <lticm:property name="launch_url">https://example.com/prod/lticontroller/ltiaction</lticm:property>
    <lticm:property name="domain">example.com</lticm:property>
    <lticm:property name="test_launch_url">https://example.com/dev/lticontroller/ltiaction</lticm:property>
    <lticm:property name="test_domain">example.com</lticm:property>
    <lticm:property name="beta_launch_url">https://example.com/dev/lticontroller/ltiaction</lticm:property>
    <lticm:property name="beta_domain">example.com</lticm:property>
</lticm:options>

Will it only work with sub domains?

Will it work with sub folders under the same url?

j_causby
Community Participant

HI J B,

I can confirm that my conventional wisdom was correct, and it works as I noted in the first example.  That being said, it worked by leaving it on the live canvas, and waiting for the tool configuration to propagate through the environments, ie. 3 weeks for us for the tool to be replicated in test with the test domain.  Our setup has separate domains for test and prod, so I'd imagine that it doesn't matter if you use a sub domain, a sub folder or a completely different url.

That being said, in the documentation it says:

External tools can support different LTI environments for different canvas environments.

  • domain: All url domains in this tool's configuration will be replaced with this domain
  • launch_url: the blti:launch_url property that should be used for all canvas test environments. This property takes precedent over domain changes if both properties are set.

Additionally, the domain and launch_urls can be set for each canvas environment by specifying the environment as part of the property name (ie, test_launch_url, beta_domain, etc). When used in this manner, specific environment properties take precedent over the default values.

<lticm:options name="environments">
    <lticm:property name="launch_url">https://prod-domain.com/lti</lticm:property>
    <lticm:property name="domain">prod-domain.com</lticm:property>
    <lticm:property name="test_launch_url">https://test-domain.com/lti</lticm:property>
    <lticm:property name="test_domain">test-domain.com</lticm:property>
    <lticm:property name="beta_launch_url">https://test-domain.com/lti</lticm:property>
    <lticm:property name="beta_domain">test-domain.com</lticm:property>
</lticm:options>
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

One thing I noticed looking at your full configuration compared to mine is yours seems to be missing a <blti:launch_url> field in the main configuration.  Here's our xml for reference (sensitive data replaced):

<cartridge_basiclti_link
  xmlns="http://www.imsglobal.org/xsd/imslticc_v1p0"
  xmlns:blti="http://www.imsglobal.org/xsd/imsbasiclti_v1p0"
  xmlns:lticm="http://www.imsglobal.org/xsd/imslticm_v1p0"
  xmlns:lticp="http://www.imsglobal.org/xsd/imslticp_v1p0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://www.imsglobal.org/xsd/imslticc_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticc_v1p0.xsd http://www.imsglobal.org/xsd/imsbasiclti_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imsbasiclti_v1p0p1.xsd http://www.imsglobal.org/xsd/imslticm_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticm_v1p0.xsd http://www.imsglobal.org/xsd/imslticp_v1p0 http://www.imsglobal.org/xsd/lti/ltiv1p0/imslticp_v1p0.xsd">

  <blti:title>Canvas Live Lecture Capture Admin Tool</blti:title>
  <blti:launch_url>https://prod-domain.com/lti</blti:launch_url>
  <blti:custom>
    <lticm:property name="tool">admin-ng/index.html#/events/events?storage=%7B%22sorter%22%3A%7B%22events%22%3A%7B%22technical_date%22%3A%7B%22name%22%3A%22technical_date%22%2C%22priority%22%3A0%2C%22order%22%3A%22DESC%22%7D%7D%7D%2C%22filter%22%3A%7B%22events%22%3A%7B%22series%22%3A%22${Canvas.course.id}%22%7D%7D%7D</lticm:property>
  </blti:custom>
  <blti:extensions platform="canvas.instructure.com">
    <lticm:property name="tool_id">lecture_capture_admin</lticm:property>
    <lticm:property name="privacy_level">public</lticm:property>
    <lticm:options name="course_navigation">
      <lticm:property name="enabled">true</lticm:property>
      <lticm:property name="text">Publish Lecture Recordings</lticm:property>
      <lticm:property name="visibility">admins</lticm:property>
      <lticm:property name="windowTarget">_blank</lticm:property>
    </lticm:options>
    <lticm:options name="environments">
        <lticm:property name="launch_url">https://prod-domain.com/lti</lticm:property>
        <lticm:property name="domain">prod-domain.com</lticm:property>
        <lticm:property name="test_launch_url">https://test-domain.com/lti</lticm:property>
        <lticm:property name="test_domain">test-domain.com</lticm:property>
        <lticm:property name="beta_launch_url">https://test-domain.com/lti</lticm:property>
        <lticm:property name="beta_domain">test-domain.com</lticm:property>
      </lticm:options>
  </blti:extensions>
</cartridge_basiclti_link>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
agschmid
Community Contributor

We've been using environment variables for a couple of years now, and this is how we got it to work:

In the XML file, the following line under <lticm:options name="course_navigation"> needs to be removed (if present):

        <lticm:property name="url">PRODUCTION_URL</lticm:property>

 

The following needs to be added to XML files in order to use the environment variables:

 

<lticm:options name="environments">

        <lticm:property name="launch_url">URL_FOR_PRODUCTION_GOES_HERE</lticm:property>

        <lticm:property name="domain">PRODUCTION_DOMAIN</lticm:property>

        <lticm:property name="test_launch_url">URL_FOR_TEST_GOES_HERE</lticm:property>

        <lticm:property name="test_domain">TEST_DOMAIN</lticm:property>

        <lticm:property name="beta_launch_url">URL_FOR_BETA_GOES_HERE</lticm:property>

        <lticm:property name="beta_domain">BETA_DOMAIN</lticm:property>

</lticm:options>