Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 400 and 402] [Versions 401 and 402] [Versions 402 and 403]

(no description)

File Size: 520 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: LtiMessageLaunch  - X-Ref

__construct(IDatabase $database,ICache $cache = null,ICookie $cookie = null,ILtiServiceConnector $serviceConnector = null)   X-Ref
Constructor.

param: IDatabase            $database         Instance of the database interface used for looking up registrations and deployments
param: ICache               $cache            Instance of the Cache interface used to loading and storing launches
param: ICookie              $cookie           Instance of the Cookie interface used to set and read cookies
param: ILtiServiceConnector $serviceConnector Instance of the LtiServiceConnector used to by LTI services to make API requests

new(IDatabase $database,ICache $cache = null,ICookie $cookie = null,ILtiServiceConnector $serviceConnector = null)   X-Ref
Static function to allow for method chaining without having to assign to a variable first.


fromCache($launch_id,IDatabase $database,ICache $cache = null,ILtiServiceConnector $serviceConnector = null)   X-Ref
Load an LtiMessageLaunch from a Cache using a launch id.

param: string    $launch_id The launch id of the LtiMessageLaunch object that is being pulled from the cache
param: IDatabase $database  Instance of the database interface used for looking up registrations and deployments
param: ICache    $cache     Instance of the Cache interface used to loading and storing launches. If non is provided launch data will be store in $_SESSION.
return: LtiMessageLaunch A populated and validated LtiMessageLaunch

validate(array $request = null)   X-Ref
Validates all aspects of an incoming LTI message launch and caches the launch if successful.

param: array|string $request An array of post request parameters. If not set will default to $_POST.
return: LtiMessageLaunch Will return $this if validation is successful

hasNrps()   X-Ref
Returns whether or not the current launch can use the names and roles service.

return: bool Returns a boolean indicating the availability of names and roles

getNrps()   X-Ref
Fetches an instance of the names and roles service for the current launch.

return: LtiNamesRolesProvisioningService An instance of the names and roles service that can be used to make calls within the scope of the current launch

hasGs()   X-Ref
Returns whether or not the current launch can use the groups service.

return: bool Returns a boolean indicating the availability of groups

getGs()   X-Ref
Fetches an instance of the groups service for the current launch.

return: LtiCourseGroupsService An instance of the groups service that can be used to make calls within the scope of the current launch

hasAgs()   X-Ref
Returns whether or not the current launch can use the assignments and grades service.

return: bool Returns a boolean indicating the availability of assignments and grades

getAgs()   X-Ref
Fetches an instance of the assignments and grades service for the current launch.

return: LtiAssignmentsGradesService An instance of the assignments an grades service that can be used to make calls within the scope of the current launch

isDeepLinkLaunch()   X-Ref
Returns whether or not the current launch is a deep linking launch.

return: bool Returns true if the current launch is a deep linking launch

getDeepLink()   X-Ref
Fetches a deep link that can be used to construct a deep linking response.

return: LtiDeepLink An instance of a deep link to construct a deep linking response for the current launch

isSubmissionReviewLaunch()   X-Ref
Returns whether or not the current launch is a submission review launch.

return: bool Returns true if the current launch is a submission review launch

isResourceLaunch()   X-Ref
Returns whether or not the current launch is a resource launch.

return: bool Returns true if the current launch is a resource launch

getLaunchData()   X-Ref
Fetches the decoded body of the JWT used in the current launch.

return: array|object Returns the decoded json body of the launch as an array

getLaunchId()   X-Ref
Get the unique launch id for the current launch.

return: string A unique identifier used to re-reference the current launch in subsequent requests

getMissingRegistrationErrorMsg(string $issuerUrl, ?string $clientId = null)   X-Ref
No description

getPublicKey()   X-Ref
No description

getKeyAlgorithm(array $key)   X-Ref
If alg is omitted from the JWK, infer it from the JWT header alg.
See https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.


jwtAlgMatchesJwkKty($key)   X-Ref
No description

cacheLaunchData()   X-Ref
No description

validateState()   X-Ref
No description

validateJwtFormat()   X-Ref
No description

validateNonce()   X-Ref
No description

validateRegistration()   X-Ref
No description

validateJwtSignature()   X-Ref
No description

validateDeployment()   X-Ref
No description

validateMessage()   X-Ref
No description

getMessageValidator(array $jwtBody)   X-Ref
No description