|
1 | | -# LTI 1.3 Advantage Demo Tool And Library |
2 | | -This code consists of two parts: |
3 | | -A library for creating LTI tool providers in PHP. |
4 | | -An collection of example tools that utilize the library. |
5 | | - |
6 | | -# Running The Example Code |
7 | | - |
8 | | -## Setup |
9 | | -The example is all written in PHP, and it also contains a docker compose file for easy setup if you have docker installed. |
10 | | - |
11 | | -### Registration and Deployment |
12 | | -First thing you will need is to configure your registration and deployment in the example code's fake registrations database. |
13 | | - |
14 | | -This can be found in each example tool's code at `db/configs/local.json`. |
15 | | -To configure your registration add a JSON object into the `local.json` file in the following format. |
16 | | - |
17 | | -```javascript |
18 | | -{ |
19 | | - "<issuer>" : { // This will usually look something like 'http://example.com' |
20 | | - "client_id" : "<client_id>", // This is the id received in the 'aud' during a launch |
21 | | - "auth_login_url" : "<auth_login_url>", // The platform's OIDC login endpoint |
22 | | - "auth_token_url" : "<auth_token_url>", // The platform's service authorization endpoint |
23 | | - "key_set_url" : "<key_set_url>", // The platform's JWKS endpoint |
24 | | - "private_key_file" : "<path_to_private_key>", // Relative path to the tool's private key |
25 | | - "deployment" : { |
26 | | - "<deployment_id>" : "<deployment_id>" // The deployment_id passed by the platform during launch |
27 | | - } |
28 | | - } |
29 | | -} |
30 | | -``` |
31 | 1 |
|
32 | | -### Running in Docker |
33 | | -To run in docker you will need both `docker` and `docker-compose` |
| 2 | +| **Note** : If you are looking for the example tool that uses this library, it has been moved into its own repo https://github.com/IMSGlobal/lti-1-3-php-example-tool | |
| 3 | +| --- | |
34 | 4 |
|
35 | | -To get the examples up and running in docker simply run: |
36 | | -``` |
37 | | -docker-compose up --build |
38 | | -``` |
39 | | - |
40 | | -There are now two example tools you can launch into on the port 9001: |
41 | | -``` |
42 | | -Simple Example: |
43 | | -OIDC Login URL http://localhost:9001/example/login.php |
44 | | -LTI Launch URL http://localhost:9001/example/launch.php |
45 | | -
|
46 | | -Game Example: |
47 | | -OIDC Login URL http://localhost:9001/game_example/login.php |
48 | | -LTI Launch URL http://localhost:9001/game_example/game.php |
49 | | -``` |
50 | | - |
51 | | -You're now free to launch in and use the tool. |
| 5 | +# LTI 1.3 Advantage Library |
| 6 | +This code consists of a library for creating LTI tool providers in PHP. |
52 | 7 |
|
53 | 8 | # Library Documentation |
54 | 9 |
|
55 | 10 | ## Importing the library |
| 11 | +### Using Composer |
| 12 | +Add the following to your `composer.json` file |
| 13 | +```json |
| 14 | +"repositories": [ |
| 15 | + { |
| 16 | + "type": "vcs", |
| 17 | + "url": "https://github.com/IMSGlobal/lti-1-3-php-library" |
| 18 | + } |
| 19 | +], |
| 20 | +"require": { |
| 21 | + "imsglobal/lti-1p3-tool": "dev-master" |
| 22 | +} |
| 23 | +``` |
| 24 | +Run `composer install` or `composer update` |
| 25 | +In your code, you will now be able to use classes in the `\IMSGlobal\LTI` namespace to access the library. |
| 26 | + |
56 | 27 | ### Manually |
57 | 28 | To import the library, copy the `lti` folder inside `src` into your project and use the following code at the beginning of execution: |
58 | 29 | ```php |
59 | 30 | require_once('lti/lti.php'); |
60 | 31 | use \IMSGlobal\LTI; |
61 | 32 | ``` |
62 | 33 |
|
63 | | -### Using Composer |
64 | | -Coming soon... |
65 | | - |
66 | 34 | ## Accessing Registration Data |
67 | 35 |
|
68 | 36 | To allow for launches to be validated and to allow the tool to know where it has to make calls to, registration data must be stored. |
|
0 commit comments