Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How make a full implementation #69

Open
sebitaas96-ss opened this issue Aug 30, 2022 · 5 comments
Open

How make a full implementation #69

sebitaas96-ss opened this issue Aug 30, 2022 · 5 comments

Comments

@sebitaas96-ss
Copy link

Good morning ,

Has anyone managed to make a complete implementation of this Lti-1-3 package, we would be grateful if you could share the information with us.

thanks.

@dbhynds
Copy link
Member

dbhynds commented Oct 18, 2022

We're actively using this in our product. We use it for launches, AGS, and NRPS. We don't currently use deep linking, but others do. I haven't had time to mock up a full demo implementation, but if there are specific things you have questions about, I'm happy to answer them.

I'm assuming you've seen it already, but if not we have some information in the wiki: https://github.com/packbackbooks/lti-1-3-php-library/wiki If you have suggestions of how to improve it, I'd love to hear them.

@battis
Copy link

battis commented Jul 21, 2023

Digging into the documentation, and I see that the the example implementation in the documentation refers to App\Models\Issuer and App\Models\Deployment -- which I infer an implementation needs to define? Is there guidance on what these models need to include?

@battis
Copy link

battis commented Jul 24, 2023

FWIW, I've been poking at this, the missing piece is really the model migrations for Issuer and Deployment. I'm still futzing with getting this up and running on Google App Engine (it's own special problem), but my notes from getting this set up so far, which I include here rather than editing the wiki because I have limited confidence:

Working from the Laravel impelementation guide:

curl -s "https://laravel.build/<lti-tool-name>" | bash
cd <lti-tool-name>
composer require packbackbooks/lti-1p3-tool firebase/php-jwt
rm app/Models/User.php
php artisan make:model Issuer --all

In database/migrations/<timestamp>_create_issuer_table.php in up():

$table->string('auth_token_url');
$table->string('auth_login_url');
$table->string('client_id');
$table->string('key_set_url');
$table->string('kid');
$table->string('issuer');
$table->string('tool_private_key');
php artisan make:model Deployment --all

In database/migrations/<timestamp>_create_deployment_table.php in up():

$table->string('deployment_id');

Copy-paste app/Providers/AppServiceProvider.php from wiki then add:

use Packback\Lti1p3\LtiServiceConnector;

Copy-paste app/Lti13Cache.php from wiki, then add:

use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;

Copy-paste app/Lti13Cookie.php from wiki:

Copy-paste app/Lti13Database.php from wiki.

mkdir app/Services

Copy-paste app/Services/Lti13Service.php from wiki.

Throughout, add namespaces as appropriate.

@dbhynds
Copy link
Member

dbhynds commented Sep 11, 2023

You'll probably want a foreign key from the Deployment to the Issuer. That way you can query on that relation, since there is almost guaranteed to be a collision in deployment_id if you have more than one instance of the same type of LMS integrating with your tool. You'll need to be able to do

// This:
$issuer->deployments()->where('deployment_id', $deploymentId)->first();
// Not this:
Deployment::where('deployment_id', $deploymentId)->first();

@datavoyager
Copy link

You'll probably want a foreign key from the Deployment to the Issuer. That way you can query on that relation, since there is almost guaranteed to be a collision in deployment_id if you have more than one instance of the same type of LMS integrating with your tool. You'll need to be able to do

// This:
$issuer->deployments()->where('deployment_id', $deploymentId)->first();
// Not this:
Deployment::where('deployment_id', $deploymentId)->first();

Can you let me know where this code goes? Is it in the issuer migration file or is it already part of the code base in findDeployment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants