1 | <div align="center">
|
2 | <br>
|
3 | <br>
|
4 | <a href="https://cvmcosta.github.io/ltijs"><img width="360" src="https://raw.githubusercontent.com/Cvmcosta/ltijs/987de79b9a3d529b1b507baa7b7a95d32ab386c2/docs/logo-300.svg?sanitize=true"></img></a>
|
5 | </div>
|
6 |
|
7 |
|
8 |
|
9 | > Turn your application into a fully integratable LTI 1.3 tool provider or consumer.
|
10 |
|
11 |
|
12 | [![travisci](https://img.shields.io/travis/cvmcosta/ltijs.svg)](https://travis-ci.org/Cvmcosta/ltijs)
|
13 | [![codecov](https://codecov.io/gh/Cvmcosta/ltijs/branch/master/graph/badge.svg)](https://codecov.io/gh/Cvmcosta/ltijs)
|
14 | [![Node Version](https://img.shields.io/node/v/ltijs.svg)](https://www.npmjs.com/package/ltijs)
|
15 | [![NPM package](https://img.shields.io/npm/v/ltijs.svg)](https://www.npmjs.com/package/ltijs)
|
16 | [![NPM downloads](https://img.shields.io/npm/dm/ltijs)](https://www.npmjs.com/package/ltijs)
|
17 | [![dependencies Status](https://david-dm.org/cvmcosta/ltijs/status.svg)](https://david-dm.org/cvmcosta/ltijs)
|
18 | [![devDependencies Status](https://david-dm.org/cvmcosta/ltijs/dev-status.svg)](https://david-dm.org/cvmcosta/ltijs?type=dev)
|
19 | [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
|
20 | [![APACHE2 License](https://img.shields.io/github/license/cvmcosta/ltijs)](LICENSE)
|
21 | [![Donate](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffe-blue)](https://www.buymeacoffee.com/UL5fBsi)
|
22 |
|
23 |
|
24 | > v2.4.0
|
25 | > MAJOR CHANGE
|
26 | > - Security update, `state` parameter is now validated at the end of the OIDC login flow.
|
27 | > - Security update, `iss` parameter is now validated at the end of the OIDC login flow.
|
28 |
|
29 | > - View entire [CHANGELOG](https://cvmcosta.github.io/ltijs/#/changelog)
|
30 |
|
31 | #### Tested on:
|
32 |
|
33 | | Version | Moodle | Canvas |
|
34 | | ---- | - | - |
|
35 | | 2.4 | <center>✔️</center> | <center></center> |
|
36 | | 2.3 | <center>✔️</center> | <center>✔️</center> |
|
37 | | 2.1 | <center>✔️</center> | <center>✔️</center> |
|
38 | | 2.0 | <center>✔️</center> | <center>✔️</center> |
|
39 |
|
40 | <sub>**Previous versions are no longer officially supported*</sub>
|
41 |
|
42 | ## Table of Contents
|
43 |
|
44 | - [Introduction](#introduction)
|
45 | - [Installation](#installation)
|
46 | - [Features](#features)
|
47 | - [Usage](#usage)
|
48 | - [Documentation](#documentation)
|
49 | - [Tutorial](#tutorial)
|
50 | - [Contributing](#contributing)
|
51 | - [License](#license)
|
52 |
|
53 |
|
54 | ---
|
55 | ## Introduction
|
56 | According to the [IMS Global Learning Consortium](https://www.imsglobal.org/), the Learning Tools Interoperability (LTI) protocol is an IMS standard for integration of rich learning applications within educational environments. <sup>[ref](https://www.imsglobal.org/spec/lti/v1p3/)</sup>
|
57 |
|
58 |
|
59 | This package implements a tool provider and consumer (currently in development) as an [Express](https://expressjs.com/) server, with preconfigured routes and methods that manage the [LTI 1.3](https://www.imsglobal.org/spec/lti/v1p3/) protocol for you. Making it fast and simple to create a working learning tool without having to worry about manually implementing any of the security and validation required to do so.
|
60 |
|
61 |
|
62 | ---
|
63 |
|
64 |
|
65 | ## Installation
|
66 |
|
67 | ### Installing the package
|
68 |
|
69 | ```shell
|
70 | $ npm install ltijs
|
71 | ```
|
72 | ### MongoDB
|
73 | - This package uses mongoDB to store and manage the server data, so you need to have it installed, see link bellow for further instructions.
|
74 | [Installing mongoDB](https://docs.mongodb.com/manual/administration/install-community/)
|
75 |
|
76 | ### PostgreSQL
|
77 | - This package can also use PosgreSQL to store and manage the server data, it does so through the plugin [ltijs-postgresql](https://www.npmjs.com/package/ltijs-postgresql).
|
78 |
|
79 |
|
80 | ### Firestore
|
81 | - This package can also use Firestore to store and manage the server data, it does so through the plugin [ltijs-firestore](https://github.com/lucastercas/ltijs-firestore).
|
82 |
|
83 |
|
84 | ---
|
85 |
|
86 | ## Features
|
87 |
|
88 | | Feature | Implementation | Documentation |
|
89 | | --------- | - | - |
|
90 | | Provider | <center>✔️</center> | <center>✔️</center> |
|
91 | | [Platform Class](https://cvmcosta.github.io/ltijs/#/platform) | <center>✔️</center> | <center>✔️</center> |
|
92 | | Database plugins | <center>✔️</center> | <center>✔️</center> |
|
93 | | [Keyset endpoint support](https://cvmcosta.me/ltijs/#/provider?id=keyset-endpoint) | <center>✔️</center> | <center>✔️</center> |
|
94 | | Grade Service Class | <center>✔️</center> | <center></center> |
|
95 | | Firebase support | <center>✔️</center> | <center></center> |
|
96 | | MySql support | <center></center> | <center></center> |
|
97 | | Redis caching | <center></center> | <center></center> |
|
98 | | Names and Roles Service Class | <center></center> | <center></center> |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 | This package implements LTI Provider and Consumer servers. See bellow for specific documentations.
|
104 |
|
105 | ### [LTIjs Provider Documentation](https://cvmcosta.github.io/ltijs/#/provider)
|
106 | - [Platform class documentation](https://cvmcosta.github.io/ltijs/#/platform)
|
107 |
|
108 | ### ~~LTIjs Consumer Documentation~~ (Coming soon)
|
109 |
|
110 | ---
|
111 |
|
112 | ## Usage
|
113 |
|
114 | ### Example of provider usage
|
115 |
|
116 | > Install LTIJS
|
117 |
|
118 | ```shell
|
119 | $ npm install ltijs
|
120 | ```
|
121 |
|
122 | > Install mongoDB
|
123 |
|
124 | - [Installing mongoDB](https://docs.mongodb.com/manual/administration/install-community/)
|
125 |
|
126 |
|
127 | > Instantiate and use Provider class
|
128 |
|
129 |
|
130 |
|
131 | ```javascript
|
132 | const path = require('path')
|
133 |
|
134 | // Require Provider
|
135 | const LTI = require('ltijs').Provider
|
136 |
|
137 | // Configure provider
|
138 | const lti = new LTI('EXAMPLEKEY',
|
139 | { url: 'mongodb://localhost/database' },
|
140 | { appUrl: '/', loginUrl: '/login', logger: true })
|
141 |
|
142 |
|
143 | let setup = async () => {
|
144 | // Deploy and open connection to the database
|
145 | await lti.deploy()
|
146 |
|
147 | // Register platform
|
148 | let plat = await lti.registerPlatform({
|
149 | url: 'https://platform.url',
|
150 | name: 'Platform Name',
|
151 | clientId: 'TOOLCLIENTID',
|
152 | authenticationEndpoint: 'https://platform.url/auth',
|
153 | accesstokenEndpoint: 'https://platform.url/token',
|
154 | authConfig: { method: 'JWK_SET', key: 'https://platform.url/keyset' }
|
155 | })
|
156 |
|
157 | // Set connection callback
|
158 | lti.onConnect((connection, request, response) => {
|
159 | // Call redirect function
|
160 | lti.redirect(response, '/main')
|
161 | })
|
162 |
|
163 | // Set main endpoint route
|
164 | lti.app.get('/main', (req, res) => {
|
165 | // Id token
|
166 | console.log(res.locals.token)
|
167 | res.send('It\'s alive!')
|
168 | })
|
169 | }
|
170 | setup()
|
171 | ```
|
172 |
|
173 | ---
|
174 |
|
175 | ## Documentation
|
176 | You can find the project documentation [here](https://cvmcosta.github.io/ltijs).
|
177 |
|
178 | ## Tutorial
|
179 |
|
180 | You can find a quick tutorial on how to set ltijs up and use it to send grades to a Moodle platform [here](https://medium.com/@cvmcosta2/creating-a-lti-provider-with-ltijs-8b569d94825c).
|
181 |
|
182 | ---
|
183 |
|
184 | ## Contributing
|
185 |
|
186 | Please ⭐️ the repo, it always helps!
|
187 |
|
188 | If you find a bug or think that something is hard to understand feel free to open an issue or contact me on twitter [@cvmcosta](https://twitter.com/cvmcosta), pull requests are also welcome :)
|
189 |
|
190 |
|
191 | And if you feel like it, you can donate any amount through paypal, it helps a lot.
|
192 |
|
193 | [![Donate](https://img.shields.io/badge/Donate-Buy%20me%20a%20coffe-blue)](https://www.buymeacoffee.com/UL5fBsi)
|
194 |
|
195 | ### Contributors
|
196 |
|
197 | <table>
|
198 | <tr>
|
199 | <td align="center"><a href="https://github.com/Cvmcosta"><img src="https://avatars2.githubusercontent.com/u/13905368?s=460&v=4" width="100px;" alt="Carlos Costa"/><br /><sub><b>Carlos Costa</b></sub></a><br /><a href="#" title="Code">💻</a><a href="#" title="Answering Questions">💬</a> <a href="#" title="Documentation">📖</a> <a href="#" title="Reviewed Pull Requests">👀</a> <a href="#" title="Talks">📢</a></td>
|
200 | <td align="center"><a href="https://github.com/lucastercas"><img src="https://avatars1.githubusercontent.com/u/45924589?s=460&v=4" width="100px;" alt="Lucas Terças"/><br /><sub><b>Lucas Terças</b></sub></a><br /><a href="#" title="Documentation">📖</a> <a href="https://github.com/lucastercas/ltijs-firestore" title="Tools">🔧</a></td>
|
201 | <td align="center"><a href="https://github.com/micaelgoms"><img src="https://avatars0.githubusercontent.com/u/23768058?s=460&v=4" width="100px;" alt="Micael Gomes"/><br /><sub><b>Micael Gomes</b></sub></a><br /><a href="#" title="Design">🎨</a></td>
|
202 |
|
203 | </tr>
|
204 |
|
205 | </table>
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | ---
|
211 |
|
212 | ## License
|
213 |
|
214 | [![APACHE2 License](https://img.shields.io/github/license/cvmcosta/ltijs)](LICENSE)
|
215 |
|