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

Workflow implementation of LTI as a Platform #152

Open
abanghendri opened this issue Nov 22, 2022 · 10 comments
Open

Workflow implementation of LTI as a Platform #152

abanghendri opened this issue Nov 22, 2022 · 10 comments

Comments

@abanghendri
Copy link

Hello, I need help about this package, I still confuse about step by step guide if I want integrate my laravel app as a LTI platform, I use moodle as LTI Tool provider and moodle give me Registration URL, what can I do with that link? I cannot find any code that tell me to process that link, what essential routes needed to be a Platform, how to process from Registration URL and get all the data from tool provider and then launch the course.

thank you in advance

@anubhabmondalDirac
Copy link

@abanghendri do you implement this library successfully in your tool end?

@abanghendri
Copy link
Author

@anubhabmondalDirac yes, I'm able to implement it until content launch
but now I face some issue on NRPS and AGS service
I use moodle for LTI consumer, but when I access moodle token, I always got this error

 OAT \ Library \ Lti1p3Core \ Exception \ LtiException (400)
Cannot get line item: Cannot get access token: Client error: `POST http://moodle.local/mod/lti/token.php` resulted in a `400 Bad Request` response: { "error" : "Cannot handle token prior to 2023-02-10T16:39:07+0700" } 

I don't know if this error comes from this library or moodle, because it says 400 which mean client (my platform) error

@anubhabmondalDirac
Copy link

@abanghendri oh okk ..
Sorry, I am also new to LTI 1.3. I am trying to understand how to embed it into my tool I am also using Moodle for LMS.
Do you have any code examples to understand the workflow and launch?
Thanks!

@anubhabmondalDirac
Copy link

How can I implement find registration? what will be my code structure any one help?

use OAT\Library\Lti1p3Core\Registration\RegistrationInterface;
use OAT\Library\Lti1p3Core\Registration\RegistrationRepositoryInterface;

$registrationRepository = new class implements RegistrationRepositoryInterface
{
public function find(string $identifier): ?RegistrationInterface
{
// TODO: Implement find() method to find a registration by identifier, or null if not found.
}

public function findAll(): array
{
// TODO: Implement findAll() method to find all available registrations.
}

public function findByClientId(string $clientId) : ?RegistrationInterface
{
// TODO: Implement findByClientId() method to find a registration by client id, or null if not found.
}

public function findByPlatformIssuer(string $issuer, string $clientId = null): ?RegistrationInterface
{
// TODO: Implement findByPlatformIssuer() method to find a registration by platform issuer, and client id if provided.
}

public function findByToolIssuer(string $issuer, string $clientId = null): ?RegistrationInterface
{
// TODO: Implement findByToolIssuer() method to find a registration by tool issuer, and client id if provided.
}
};

any demo example code available ?
Thanks in advance !

@abanghendri
Copy link
Author

since it our company's propietary code thus I cannot share as is to anyone, so I'll back to you as soon as possible with my new integration example, may be 2-4 days @anubhabmondalDirac

@anubhabmondalDirac
Copy link

Ok, I understand. Thank you so much.

@abanghendri
Copy link
Author

Hi @anubhabmondalDirac , you can fork my repo here
Laravel LTI Example

the steps is

  1. you need some endpoint (OIDC init, Launch URL, Deeplinking URL, JWKS URL)
  2. you can register your tool to moodle, then you can insert moodle's information to your tool as a platform

@anubhabmondalDirac
Copy link

@abanghendri Thank you so much. For me, it will be beneficial.
But my tool is based on PHP Codeigniter, I never use laravel but will try to implement it as you say.
Thanks again!

@abanghendri
Copy link
Author

@anubhabmondalDirac not too different I think, I used to use Codeigniter too, since this library is framework agnostic, you can use it on any PHP project even on native PHP
I just use ordinary controller and traits which also supported by CI framework

@anubhabmondalDirac
Copy link

@abanghendri Thanks, I will try my best.

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

2 participants