Skip to content

Commit

Permalink
Support Schoology
Browse files Browse the repository at this point in the history
  • Loading branch information
bjmrey authored and chrispittman committed Aug 8, 2022
1 parent f9cb4c0 commit 4f564fc
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Commands/AddLti1p3Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public function handle()
$this->warn(" lms_type can be one of:");
$this->warn(" * 'canvas-cloud' - Cloud-hosted instances of Canvas LMS");
$this->warn(" * 'moodle' - Moodle");
$this->warn(" * 'schoology' - Schoology");
$this->warn(" * 'custom' - Any other LMS.");
$this->warn('See https://github.com/longhornopen/laravel-celtic-lti/wiki/LTI-Key-Generation for the locations of the client and deployment IDs in your LMS.');
return 0;
Expand Down Expand Up @@ -86,6 +87,15 @@ public function handle()
return 0;
}

if ($this->argument('lms_type') === 'schoology') {
PlatformCreator::createLTI1p3PlatformSchoology(
$dataConnector,
$deployment_id,
$client_id);
$this->info("Successfully created.");
return 0;
}

if ($this->argument('lms_type') === 'custom') {
// FIXME hook up a bunch of command-line flags to the args in PlatformCreator::createLTI1p3Platform
$this->error("Custom LTI 1.3 configurations not supported yet. Use PlatformCreator directly for the moment.");
Expand Down
27 changes: 27 additions & 0 deletions src/PlatformCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,31 @@ public static function createLTI1p3PlatformMoodle(
$authorization_server_id
);
}
public static function createLTI1p3PlatformSchoology(
LTI\DataConnector\DataConnector $dataConnector,
$deployment_id,
$client_id
)
{
$platform_id = 'https://schoology.schoology.com';
$rsa_key = null; // a public key is not required if a JKU is available
$signature_method = 'RS256';

$jku = 'https://lti-service.svc.schoology.com/lti-service/.well-known/jwks';
$authentication_url = 'https://lti-service.svc.schoology.com/lti-service/authorize-redirect';
$access_token_url = 'https://lti-service.svc.schoology.com/lti-service/access-token';
$authorization_server_id = null; // defaults to the Access Token URL
self::createLTI1p3Platform(
$dataConnector,
$platform_id,
$deployment_id,
$client_id,
$jku,
$rsa_key,
$signature_method,
$authentication_url,
$access_token_url,
$authorization_server_id
);
}
}

0 comments on commit 4f564fc

Please sign in to comment.