Skip to content

Commit

Permalink
add support for test+beta canvas-cloud instances
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispittman committed Dec 19, 2022
1 parent 4f564fc commit d13f6a6
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/PlatformCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,28 @@ public static function createLTI1p3PlatformCanvasCloud(
$client_id
)
{
$platform_id = 'https://canvas.instructure.com';
$rsa_key = null; // a public key is not required if a JKU is available
$signature_method = 'RS256';
foreach (['canvas.instructure.com','canvas.beta.instructure.com','canvas.test.instructure.com'] as $base_url) {
$platform_id = 'https://' . $base_url;
$rsa_key = null; // a public key is not required if a JKU is available
$signature_method = 'RS256';

$jku = 'https://canvas.instructure.com/api/lti/security/jwks';
$authentication_url = 'https://canvas.instructure.com/api/lti/authorize_redirect';
$access_token_url = 'https://canvas.instructure.com/login/oauth2/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
);
$jku = 'https://' . $base_url . '/api/lti/security/jwks';
$authentication_url = 'https://' . $base_url . '/api/lti/authorize_redirect';
$access_token_url = 'https://' . $base_url . '/login/oauth2/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
);
}
}

public static function createLTI1p3PlatformMoodle(
Expand Down

0 comments on commit d13f6a6

Please sign in to comment.