|null */ public function getLaunchData(string $key): ?array { return Cache::get("lti1p3-lancement-{$key}"); } /** * @param array $jwtBody */ public function cacheLaunchData(string $key, array $jwtBody): void { Cache::put("lti1p3-lancement-{$key}", $jwtBody, self::EXPIRATION_DONNEES_LANCEMENT); } public function cacheNonce(string $nonce, string $state): void { Cache::put("lti1p3-nonce-{$nonce}", $state, self::EXPIRATION_NONCE); } public function checkNonceIsValid(string $nonce, string $state): bool { $etatEnCache = Cache::get("lti1p3-nonce-{$nonce}"); if ($etatEnCache === null) { return false; } Cache::forget("lti1p3-nonce-{$nonce}"); return $etatEnCache === $state; } public function cacheAccessToken(string $key, string $accessToken): void { Cache::put("lti1p3-jeton-{$key}", $accessToken, self::EXPIRATION_JETON_ACCES); } public function getAccessToken(string $key): ?string { return Cache::get("lti1p3-jeton-{$key}"); } public function clearAccessToken(string $key): void { Cache::forget("lti1p3-jeton-{$key}"); } }