Annotation of loncom/html/adm/help/tex/Domain_Configuration_LTI_Provider.tex, revision 1.4
1.1 raeburn 1: \label{Domain_Configuration_LTI_Provider}
2:
1.3 raeburn 3: LTI (Learning Tool Interoperability) Provider functionality is used in two ways in LON-CAPA.
4:
5: \begin{enumerate}
6: \item Enforce deep-link only access to specific LON-CAPA course folder(s) or resource(s), via External Tool launch in a different learning management system.
7: \item Provide basic LTI authentication, whereby a session can be established in LON-CAPA (the LTI Provider) for users already logged into a different system (the LTI Consumer), without re-authentication.
8: \end{enumerate}
9:
10: To support these modes of operation the following can be set in a domain:
1.1 raeburn 11:
12: \begin{itemize}
13:
1.3 raeburn 14: \item Encryption of shared secrets
15: \item Rules for shared secrets
16: \item Link Protectors
17: \item Consumers
18:
19: \end{itemize}
20:
1.4 ! raeburn 21: LTI employs a shared key and secret which the launcher (LTI Consumer) and the target (LTI Provider) will store locally. The key will be included in the (signed) payload included in a request created by the Consumer and sent to the Provider on launch. The Provider will use the key and secret to verify that the contents of the payload has not been tampered with in transit. As the payload can include the user's identity, which LON-CAPA can be configured to use to establish a session for that user, it is important that the secret for a particular LTI launch item remain private. To assist with that, LON-CAPA offers the option to encrypt a secret when storing it on a domain's library server.
1.3 raeburn 22:
23: Accordingly, an encryption key can be set on the primary library server in a LON-CAPA domain. That encryption key will be used to encrypt a shared secret when storing it, and to decrypt it when it needs to be used to verify payload integrity.
24:
25: \textbf{Link Protection}
1.1 raeburn 26:
1.3 raeburn 27: Link protection credentials can be configured at a domain level (by a Domain Coordinator), or at a course level (by a Course Coordinator), and the option is available to encrypt secret(s) at either or both of those levels. In addition, secret(s) used for basic LTI authentication can also be set to be encrypted prior to storage in LON-CAPA.
1.1 raeburn 28:
1.3 raeburn 29: Rules can be established for length and types of characters required in any secret assigned to a launch item.
1.1 raeburn 30:
1.3 raeburn 31: Link Protectors configured in a domain are numbered incrementally (starting at 1).
32:
33: For each Link Protector the following need to be specified:
34: \begin{itemize}
35: \item Launcher Name
36: \item LTI Version
37: \item Nonce lifetime (s)
38: \item Key
39: \item Secret
1.1 raeburn 40: \end{itemize}
41:
1.3 raeburn 42: The \textbf{Launcher Name} is used to identify an option shown in the ``domain LTI launch'' drop-down list when setting a value for the deeplink parameter in the Parameter Manager in a course. Its value can be changed without impacting the behavior of the link, as LON-CAPA internally stores the launcher item associated with a deep-link using the unique numeric identifier assigned to the launcher item when it was first created.
43:
44: The \textbf{LTI Version} will be 1.1. It is expected that newer versions will also be supported in the future.
1.1 raeburn 45:
1.3 raeburn 46: A short \textbf{Nonce lifetime} can inhibit use of replay methods to circumvent link protection provided by LTI. There should not be a need to set the value to other than the default of 300s.
1.1 raeburn 47:
1.3 raeburn 48: The \textbf{Key} and \textbf{Secret} should be kept secure, and will be needed when configuring the ``External Tool'' item in the other system which is linking to LON-CAPA. Once a Secret has been saved for a particular launcher, LON-CAPA will not display it again, so it is recommended to make a note of it, so it can be used in the other system. To change an existing Secret check the ``Yes'' for ``Change?'' to make a textbox available for entering the new Secret. Note: the Key and Secret can only be submitted from a session on a domain's primary library server, so if your session is on a different LON-CAPA server, a link to switch server will be shown in place of the textboxes for those two items.
49:
50: For each Link Protector there will also be a Yes/No option: \textbf{Use identity?}. If `Yes' is selected then two (optional) settings can be specified:
51:
52: \begin{itemize}
53: \item Source of username in LTI request
54: \item Action if username does not match enrolled student
55: \end{itemize}
56:
57: Deciding what to select as the source of the username requires knowing what the other learning system sends in the LTI Request. Ideally, the other system will provide a preview feature for instructors to use to display items included in a launch request, and values set for them (for the previewer). In LON-CAPA, selecting ``User ID'' for the username source indicates the username will be whatever was assigned to the ``lis_person_sourcedid'' parameter, whereas selecting ``Email address'' means the username will be whatever was assigned to the ``lis_person_contact_email_primary'' parameter by the launch system. If neither of those are appropriate then ``Other'' can be selected, and the appropriate parameter name in the LTI Request can be entered in the textbox.
58:
59: A username will only be accepted from the launch data for session creation in LON-CAPA if the corresponding user has already been assigned a student role, and no privileged role(s) in the target course in LON-CAPA. What will happen if that condition is not met can either be to stop the launch, or to display the LON-CAPA login page, and allow a user to authenticate. The second of those is the same behavior as seen if ``No'' had originally been selected for ``Use identity?'.
60:
61: Unlike LON-CAPA, other learning systems do not typically support multiple domains. As a result when creating a user session based on a username included in the launch payload, the implicit assumption is made that the user's domain in LON-CAPA is the same as the course's domain.
62:
63: Although the `Use identity?' option may be set to 'Yes' for a Link Protector item configured in a domain, whether or not the username included in launch data will be accepted in a particular course can be controlled on a course-by-course basis by a Domain Coordinator.
64:
65: The ``Course/Community defaults'' item \ref{Domain_Configuration_Course_Defaults} includes a Yes/No option for: ``Student username in LTI launch of deep-linked URL can be accepted without re-authentication''. A Domain Coordinator can use:
66: Main Menu $>$ Set domain configuration $>$ View or modify a course or community to select a course, and then use the ``View/Modify re-authentication requirement for LTI launch of deep-linked item'' link to override the domain default for a specific course.
67:
68: In the case where usernames are not accepted from the launch payload, then each user will need to authenticate using the standard LON-CAPA username and password after the signed payload has been verified. After authentication the user's LON-CAPA session will still be recorded as having been launched from the deep-link target URL, as long as the access control setting for the deeplink parameter for the corresponding resource, or enclosing map/folder, is configured to support launch from the external system which provided the signed payload.
69:
70: The endpoint LON-CAPA URL specified in the ``External Tool'' item in the other system will be composed of the following components: protocol or scheme (i.e., http or https), ://, hostname, /adm/launch, and the ``tiny URL' path to the target resource or folder. If the LON-CAPA domain expects all access via a single server (i.e., a LON-CAPA load-balancer/portal node), then the hostname used should be the one assigned to the load-balancer.
71:
72: As the key and secret used for launch items (either in a course or a domain) will be unavailable to LON-CAPA nodes belonging to a different LON-CAPA domain,
73: if LTI link protection is to be used for deep-linked items, it is requirement that the endpoint URL include the hostname of a LON-CAPA server in the course's domain.
74:
75: Following the hostname, the remainder of the URL will have the format: /adm/launch/tiny/\$domain/uniqueID, where /tiny/\$domain/uniqueID is a shortened URL,
76: unique to the particular folder or resource in the specific course.
77:
78: Course Coordinators can generate shortened URLs for items in a course by using:
79: Course Editor $>$ Content Utilities $>$ ``Display/Set Shortened URLs for Deep-linking''; see: Short URLs section \ref{Docs_Short_URLs}
80:
81: \textbf{Consumers}
82:
83: As noted above, use of link protectors defined either in a domain or in a course, requires that the user already has a LON-CAPA user account, and a student role assigned in a LON-CAPA course.
84:
85: If instead, more complete integration is desired between the remote (launcher) system and LON-CAPA, then a LTI Consumer item can be configured using the fourth panel: ``Consumers'' in the ``LTI Link Protection and LTI Consumers'' box.
86:
87: The extent of interoperability between Consumer and Provider, and also the behavior of a LON-CAPA course session when launched from the Consumer, are determined by the Provider configuration(s) for Consumer(s) in a LON-CAPA domain. LTI Provider configurations may be set for multiple Consumers using a unique key and secret for each. Similarly, multiple configurations (with different levels of integration) can be set for an individual Consumer, again using a unique key and secret for each configuration.
88:
89: The need for user management within a LON-CAPA course can be eliminated because users and roles can be created automatically when a user in a course in the Consumer system is transferred to the LON-CAPA environment. Pass-back of grades from LON-CAPA to the consumer can also be configured.
1.1 raeburn 90:
91: \begin{itemize}
92:
93: \item Required settings
94:
95: \item Logout options
96:
97: \item Mapping users
98:
99: \item Roles which may create user accounts
100:
101: \item New user accounts created for LTI users
102:
103: \item LON-CAPA menu items (Course Coordinator can override)
104:
105: \item Mapping courses
106:
107: \item Mapping course roles
108:
109: \item Creating courses
110:
111: \item Roles which may self-enroll
112:
113: \item Course options
114:
115: \end{itemize}
116:
117:
118: The ``Required settings'' include seven items:
119: Consumer, LTI Version, Nonce lifetime (s), User`s identity sent, Course's identity sent, Key and Secret.
120:
1.3 raeburn 121: Creation of a LON-CAPA user session in a domain as a result of launch from an LTI Consumer is only permitted on LON-CAPA nodes belonging to the same ``internet'' domain as the domain's library server. The ``internet'' domain is the last entry in the record for a particular node in the /home/httpd/lonTabs/hosts.tab file on a LON-CAPA server. Accordingly, the target URL defined in the External Tool configuration on another Learning Management System (the Consumer) should include the hostname of a node in an appropriate LON-CAPA domain.
1.1 raeburn 122:
123: If the LTI Provider setting for a Consumer has ``User`s identity sent'' set to ``No'', then user information included in the LTI payload (signed by the Consumer using the key and secret) will not be used, and a user session will not be created automatically in LON-CAPA.
124:
125: In the case where LON-CAPA will accept user identity information from launch in the Consumer, then the ``Course's identity sent'' item can optionally also be set to ``Yes''. When user identity is accepted the next five categories listed above will be available for configuration for the Consumer, although which ones are applicable depends on the capabilities of the Consumer. When course context information is accepted the remaining four categories listed above will also be available (applicability also depends on Consumer capabilities).
126:
127: When both User and Course identity are accepted from the Consumer, the configuration for each Consumer will determine who (if anyone) may:
128:
129: \begin{itemize}
130:
131: \item create a user account in LON-CAPA
132:
133: \item create a LON-CAPA course or enroll in the LON-CAPA course associated with a specific course on the Consumer side
134:
135: \end{itemize}
136:
137: and will also determine what information source(s) may be used to populate user accounts for new user(s), what type(s) of LON-CAPA course may accommodate users in sessions launched via LTI, and lastly which of the following are available on the LON-CAPA side:
138:
139: \begin{itemize}
140:
141: \item should logout from the Consumer trigger a callback to perform a user logout from LON-CAPA?
142:
143: \item which LON-CAPA menu and page header items should be available by default for user/course session(s) launched from the LTI Consumer?
144:
145: \item should newly enrolling users be assigned to a section in the LON-CAPA course?
146:
147: \item should a course roster be retrieved from the Consumer?
148:
149: \item should grades be returned to the entry in the Consumer`s gradebook for the launch item?
150:
151: \end{itemize}
152:
153: In the case of menu items, page header, and inline menu display, the values set for a domain may be overridden by a Course Coordinator in a LON-CAPA course utilizing course session launch via Consumer, via the ``LTI provider settings'' item in the course.
154:
155: If the LTI Provider functionality set for a particular Consumer accepts user identity information but not course identity information, then LON-CAPA's standard Roles/Courses page will normally be used to display roles in LON-CAPA which a user originally authenticated by an LTI Consumer may select.
156:
157: The one exception is when the destination URL is a shortcut to a specific folder or resource in a specific course, i.e., the launch URL is: /adm/lti/tiny/domain/uniqueID. In that case, if the user has an unexpired role in the course to which the tiny URL belongs, then role selection will occur automatically, and the folder or resource will be the first item displayed after the user's session has been established, as long as the mapped course item (a resource or a folder) does not have a deeplink parameter in effect which requires launch from a different Consumer.
158:
159: On the Consumer side, an instructor will typically select an External Tool item for LON-CAPA from a list of LTI-enabled tools available, as configured by an administrator who manages the Consumer system. If the Provider configuration in LON-CAPA for this Consumer accepts course information, then the destination course domain and courseID in LON-CAPA are determined in the following order:
160:
161: \begin{enumerate}
162:
1.2 raeburn 163: \item from the value of an (optional) custom\_coursedomain item in the payload sent by Consumer on launch.
1.1 raeburn 164:
165: \item from a course look-up if mapping from Consumer ``course'' and Provider ``course'' has been established previously, and stored (configurable).
166:
167: \item from tail of requested URL (after /adm/lti/) if it has the format of a LON-CAPA resource identifier (known as a symb).
168:
169: \item from tail of requested URL (after /adm/lti) if it has the format of a LON-CAPA course folder URL.
170:
171: \item from tail of requested URL (after /adm/lti) if it has the format: /domain/courseID.
172:
173: \item from tail of requested URL (after /adm/lti) if it has the format: /tiny/domain/uniqueID, i.e., a URL shortcut.
174:
175: \end{enumerate}
176:
177: If the extracted LON-CAPA course domain and/or courseID do not exist then the request is invalid, and no user session will be established.
178:
1.2 raeburn 179: When starting out with a new LON-CAPA domain there will be one user account, namely a filesystem-authenticated user with an assigned Domain Coordinator role, originally created by running the make\_domain\_coordinator.pl script on the command line. If that user accesses LON-CAPA via the standard log-in page in the web GUI, i.e., /adm/login, and selects a Domain Coordinator role, and uses Main Menu $>$ Set domain configuration $>$ Display (LTI Provider checked), to configure LTI Provider support, all subsequent access by other users can be from other LTI Consumer(s).
1.1 raeburn 180:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>