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.

(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.

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

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.

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

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.

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

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

param: string $key the key to purge.