Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

File Size: 519 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