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.

(no description)

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

Defines 1 class

launch_cache_session:: (8 methods):
  getLaunchData()
  cacheLaunchData()
  cacheNonce()
  checkNonceIsValid()
  purge()
  cacheAccessToken()
  getAccessToken()
  clearAccessToken()


Class: launch_cache_session  - X-Ref

The launch_cache_session, providing a temporary session store for launch information.

This is used to store the launch information while the user is transitioned through the Moodle authentication flows
and back to the deep linking launch handler (launch_deeplink.php).

getLaunchData($key)   X-Ref
Get the launch data from the cache.

return: array|null the launch data.
param: string $key the launch id.

cacheLaunchData(string $key, array $jwtBody)   X-Ref
Add launch data to the cache.

param: string $key the launch id.
param: array $jwtBody the launch data.

cacheNonce(string $nonce, string $state)   X-Ref
Cache the nonce.

param: string $nonce the nonce.
param: string $state the state.

checkNonceIsValid(string $nonce, string $state)   X-Ref
Check whether the cache contains the nonce.

return: bool true if found, false otherwise.
param: string $nonce the nonce
param: string $state the state

purge()   X-Ref
Delete all data from the session cache.


cacheAccessToken(string $key, string $accessToken)   X-Ref
Cache the access token.

param: string $key the key
param: string $accessToken the access token

getAccessToken(string $key)   X-Ref
Get a cached access token.

return: string|null the token string, or null if not found.
param: string $key the key to check.

clearAccessToken(string $key)   X-Ref
Clear the access token from the cache.

param: string $key the key to purge.