Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

(no description)

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

Defines 1 class

LtiMessageLaunch:: (26 methods):
  __construct()
  new()
  fromCache()
  validate()
  hasNrps()
  getNrps()
  hasGs()
  getGs()
  hasAgs()
  getAgs()
  isDeepLinkLaunch()
  getDeepLink()
  isSubmissionReviewLaunch()
  isResourceLaunch()
  getLaunchData()
  getLaunchId()
  getPublicKey()
  inferKeyAlgorithm()
  cacheLaunchData()
  validateState()
  validateJwtFormat()
  validateNonce()
  validateRegistration()
  validateJwtSignature()
  validateDeployment()
  validateMessage()


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.

return: LtiMessageLaunch a populated and validated LtiMessageLaunch
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.

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

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

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

getPublicKey()   X-Ref
No description

inferKeyAlgorithm(array $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