dbprefix}lti_key"; $current = LTIX::curPageUrlNoQuery(); $from_location = LTIX::curPageUrlFolder(); $allow_delete = true; $allow_edit = true; $where_clause = ''; $query_fields = array(); $fields = array('key_id', 'key_title', 'plus', 'user_id', 'key_key', 'secret', 'lms_issuer', 'lms_client', 'deploy_key', 'unlock_code', 'lms_oidc_auth', 'lms_keyset_url', 'lms_token_url', 'lms_token_audience', 'created_at', 'updated_at', ); $realfields = array('key_id', 'key_title', 'plus', 'key_key', 'key_sha256', 'secret', 'lms_issuer', 'lms_issuer_sha256', 'lms_client', 'deploy_key', 'deploy_sha256', 'unlock_code', 'lms_oidc_auth', 'lms_keyset_url', 'lms_token_url', 'lms_token_audience', 'created_at', 'updated_at', 'user_id', 'lti_registration_id', ); $titles = array( 'key_key' => 'LTI 1.1: OAuth Consumer Key', 'secret' => 'LTI 1.1: OAuth Consumer Secret', 'plus' => 'Tsugi Plus', 'deploy_key' => 'LTI 1.3: Deployment ID (If you leave this blank, it will match any value from the LMS)', 'lms_issuer' => 'LTI 1.3 Platform Issuer URL', 'lms_client' => 'LTI 1.3 Platform Client ID - usually a GUID', 'lms_oidc_auth' => 'LTI 1.3 Platform OIDC Login / Authorization Endpoint URL', 'lms_keyset_url' => 'LTI 1.3 Platform KeySet URL', 'lms_token_url' => 'LTI 1.3 Platform Token URL', 'lms_token_audience' => 'LTI 1.3 Platform Audience (optional)', 'unlock_code' => 'LTI 1.3: Dynamic Registration Unlock Code (one time use)', ); if ( isset($_POST['doUpdate']) || isset($_POST['doDelete']) ) { if ( \Tsugi\Controllers\Tool::csrfRedirect($from_location) ) return; } if ( isset($_POST['key_key']) && empty($_POST['key_key']) ) $_POST['key_key'] = null; if ( isset($_POST['user_id']) && empty($_POST['user_id']) ) $_POST['user_id'] = null; $raw_deploy_key = array_key_exists('deploy_key', $_POST) ? $_POST['deploy_key'] : null; if ( isset($_POST['deploy_key']) ) { $_POST['deploy_key'] = \Tsugi\Services\Admin\AdminService::normalize_deploy_key_input($_POST['deploy_key']); } if ( isset($_POST['doUpdate']) ) { $_POST['plus'] = (isset($_POST['plus']) && (string) $_POST['plus'] === '1') ? '1' : '0'; } // Check the complex interaction of constraints $key_id = U::get($_POST,'key_id'); $key_key = U::get($_POST,'key_key'); $deploy_key = U::get($_POST,'deploy_key'); // Check the complex validation if ( count($_POST) > 0 && U::get($_POST,'doUpdate') && !empty($key_id) ) { if ( ! \Tsugi\Services\Admin\AdminService::applyPostedRegistrationToKey() ) { $redir = U::add_url_parm('key-detail', 'key_id', $key_id); $redir = U::add_url_parm($redir, 'edit', 'yes'); header("Location: ".$redir); return; } $row = $PDOX->rowDie( "SELECT * FROM {$CFG->dbprefix}lti_key WHERE key_id = :key_id", array(':key_id' => $key_id) ); $redir = U::add_url_parm('key-detail', 'key_id', $key_id); $redir = U::add_url_parm($redir, 'edit', 'yes'); if ( ! $row ) { U::flashError("Could not load the old row"); header("Location: ".$redir); return; } $old_key_key = $row['key_key']; $old_deploy_key = $row['deploy_key']; $lms_issuer_val = array_key_exists('lms_issuer', $_POST) ? $_POST['lms_issuer'] : $row['lms_issuer']; $lms_client_val = array_key_exists('lms_client', $_POST) ? $_POST['lms_client'] : $row['lms_client']; $posted_secret = array_key_exists('secret', $_POST) ? $_POST['secret'] : $row['secret']; if ( $posted_secret === '' ) { $posted_secret = $row['secret']; } $posted_deploy = array_key_exists('deploy_key', $_POST) ? $raw_deploy_key : $deploy_key; $identity_message = LTI::ascii255First(array( 'OAuth consumer key' => $key_key === '' ? null : $key_key, 'Secret' => $posted_secret === '' ? null : $posted_secret, 'Issuer' => $lms_issuer_val === '' ? null : $lms_issuer_val, 'Client id' => $lms_client_val === '' ? null : $lms_client_val, 'Deployment id' => $posted_deploy === '' ? null : $posted_deploy, )); if ( is_string($identity_message) ) { U::flashError($identity_message); header("Location: ".$redir); return; } $retval = \Tsugi\Services\Admin\AdminService::validate_key_details($key_key, $deploy_key, $lms_issuer_val, $old_key_key, $old_deploy_key, $lms_client_val, $key_id); if ( ! $retval ) { header("Location: ".$redir); return; } } // Handle the post data /** @var array|int $row */ $row = CrudForm::handleUpdate($tablename, $realfields, $where_clause, $query_fields, $allow_edit, $allow_delete); if ( $row === CrudForm::CRUD_FAIL || $row === CrudForm::CRUD_SUCCESS ) { header('Location: '.$from_location); return; } if ( ! is_array($row) ) { U::flashError('Unable to load key details'); header('Location: '.$from_location); return; } $OUTPUT->header(); $OUTPUT->bodyStart(); $OUTPUT->topNav(); $OUTPUT->flashMessages(); ?>
Key status: = \Tsugi\Services\Admin\AdminService::keyTypeHtml($row) ?>
LTI Advantage Dynamic Registration URL:
= htmlentities($url) ?>
NOTE: You must set the one-time use unlock_code in the key data to get a dynamic registration URL.\n"); } } ?>A single entry in this table is one key. Data in Tsugi is isolated to a key. You can route both LTI 1.1 and LTI 1.3 launches to one key by setting fields on this entry properly. If a key is in "Draft" status, launches will not work.
For LTI 1.1, set the oauth_consumer_key and secret.
For LTI 1.3, you can either (a) create a global issuer and select it here, and then set the deployment_id if you want this key to match only that deployment, or you can (b) leave the global issuer unset and set all of the LMS values in this screen. If you mix a global issuer and per-key LTI 1.3 settings, you will most likely end up with a key that won't be able to receive launches.
For the LTI 1.3 Deployment ID field on this key: leave blank to accept any value from the LMS (Tsugi still uses the deployment id from the launch for services such as grading). Enter a specific deployment id when you want this key to accept only that deployment.
If this is a pre-existing LTI 1.1 key, the LMS must provide the oauth_consumer_key and secret connected to its LTI 1.3 launches, and then Tsugi can link the accounts and courses regardless of the type of launch. For this to work, the LMS must support LTI Advantage legacy LTI 1.1 support.
Sometimes you need to give the LMS the Tsugi URLs to make a new security arrangement before they can give you the Platform values to put into either a global issuer on this form. We solve this "who goes first" problem in Tsugi by allowing you to create a "draft" or incomplete key and then come back later to add the LMS / Platform provided data.
LTI Advantage Dynamic RegistrationSakai, Moodle, and Brightspace support the LTI Dynamic Registration process. This process takes a draft Tsugi key, and sends its data to the LMS and the LMS responds with all of its values and Tsugi automatically updates the key with the LMS values. It is basically a one-click LTI Advantage install. Create a key with at least a title and issuer (or start from a draft key), then use the Dynamic Registration URL below in the LMS.
Dynamic Registration sets up the security relationship between a tool and LMS. Values like the Issuer, ClientID, Keyset URL, etc. will be set up. If the issuer data returned by the LMS matches an existing issuer in this system, that issuer will be used for this key, otherwise the new issuer data will be added to this key.
A secondary and optional part of Dynamic Registration is to communicate the Deployment ID for this key. Sometimes this is included in the dynamic registration exchange (Sakai, Moodle, and Brightspace for example). For other LMS's you may need to run the dynamic registration process, and then manually enter the Deployment Id later if you want a specific deployment. You can also leave Deployment ID blank so the key accepts any value from the LMS. Many single-site Sakai or Moodle installs still send a concrete deployment id in launches (for example 1); a blank Deployment ID field accepts that without storing it on the key row.
Brightspace supports LTI Dynamic Registration.
In Brightspace, go to the settings (gear icon) drop down, and select External Learning Tools -> LTI Advantage -> New Deployment. Before we can create the deployment, we need to register a tool which can be launched from the help/question mark link by the "Tool" drop down that brings up a pop up - then click on Register and it will pop up a new window. Then press Register Tool.
Select Dynamic, check the Configure Deployment checkbox and enter the Dynamic Configuration URL and press Register. Brightspace will open another new tab which will come back to Tsugi. Once Tsugi and Brightspace exchange all their data, and update their respective configurations, press Continue Tool Registration in the LMS.
Then in Brightspace make sure you have a Tool, Deployment, and then set up one or more Links to tell BrightSpace where to show Tsugi in the Brightspace UI. The Deep Linking Quicklink works pretty well for Tsugi but others might be useful as well. The URL to provide to use for Deep Linking Quicklink is the Tsugi store URL:
Tsugi App Store URL:
= htmlentities($contentItemUrl) ?>
You can install Tsugi as a Content-Item (i.e. a tool picker) by using the consumer_key and consumer_secret and the following URL.
Tsugi App Store URL:
= htmlentities($contentItemUrl) ?>
You can also install direct LTI 1.1 launches to individual tools on this system. You can see any installed tools in the Tsugi App Store on this system. Each tool listing provides its direct launch endpoints.
Sakai supports LTI Dynamic Registration.
In Sakai, paths vary by version; a typical path is Administration Workspace -> External Tools -> LTI Advantage Auto Provision (or similar LTI Advantage registration).
Give the tool a title, and press Auto Provision. Sakai will create a draft integration and give you the option to Use LTI Advantage Auto Configuration - press that button and enter the Dynamic Configuration URL.
Sakai supports the optional part of Dynamic Registration and so it provides the Deployment ID for this key in the Dynamic Registration process so once the process is done, the key should be fully configured and ready to launch. You may leave Deployment ID blank on the Tsugi key so it accepts any value from the LMS; Sakai often sends deployment_id 1 in launches, which is fine when this field is blank.
You can install Tsugi as a Content-Item (i.e. a tool picker) by using the consumer_key and consumer_secret and the following URL.
Tsugi App Store URL:
= htmlentities($contentItemUrl) ?>
You can also install direct LTI 1.1 launches to individual tools on this system. You can see any installed tools in the Tsugi App Store on this system. Each tool listing provides its direct launch endpoints.
Moodle supports LTI Dynamic Registration.
In Moodle, menus vary by version; look for external tool / LTI Advantage registration (for example Site Administration -> Plugins -> Manage tools and an option to register by URL or dynamic registration).
Moodle will prompt you for the Dynamic Registration URL.
Moodle supports the optional part of Dynamic Registration and so it provides the Deployment ID for this key in the Dynamic Registration process so once the process is done, the key should be fully configured and ready to launch. You may leave Deployment ID blank on the Tsugi key so it accepts any value from the LMS; Moodle may still send a concrete deployment id in launches.
You can install Tsugi as a Content-Item (i.e. a tool picker) by using the consumer_key and consumer_secret and the following URL.
Tsugi App Store URL:
= htmlentities($contentItemUrl) ?>
You can also install direct LTI 1.1 launches to individual tools on this system. You can see any installed tools in the Tsugi App Store on this system. Each tool listing provides its direct launch endpoints.
These URLs need to be provided to your LMS registration associated with this key. You can create a draft key, then provide these values to the LMS. Then the LMS can use the values to complete its configuration process and provide you the needed values (which may include a new issuer) so that you can finish configuring this key.
LTI 1.3 OpenID Connect Endpoint: Copy = $oidc_login ?> LTI 1.3 Tool Redirect Endpoint: Copy = $oidc_redirect ?> LTI 1.3 Tool Keyset URL: Copy = $lti13_keyset ?> LTI Content Item / Deep Link Endpoint: Copy = $deep_link ?>
You can install Tsugi as a Content-Item (i.e. a tool picker) by using the consumer_key and consumer_secret and the following URL.
Canvas LTI 1.1 Configuration URL:
= htmlentities($canvasContentItemUrl) ?>
Blackboard LTI 1.3 / Advantage setup depends on your Learn version and admin UI; use your Blackboard documentation for developer keys, placements, and deployments. The URLs on the Manual Configuration tab are what you register at the LMS.
You can install Tsugi as a Content-Item (i.e. a tool picker) by using the consumer_key and consumer_secret and the following URL.
Tsugi App Store URL:
= htmlentities($contentItemUrl) ?>
You can also install direct LTI 1.1 launches to individual tools on this system. You can see any installed tools in the Tsugi App Store on this system. Each tool listing provides its direct launch endpoints.