mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-80835 enrol_lti: add partitioning support for OIDC state cookie
Adds the property that is required by Chrome to opt-in to its 3rd party cookie partitioning solution, CHIPS. This specific change ensures the 'state' cookie, used in the OIDC handshake, has partitioning support. This cookie can be partitioned unconditionally, since it's a cookie controlled by the library and one we don't expect to be set without partitioning elsewhere.
This commit is contained in:
parent
dee41e0648
commit
0f3d3b2d77
@ -5,6 +5,7 @@ This library is a patched for use in Moodle - it requires the following changes
|
||||
2. Removal of Guzzle dependency (replaced with generic http client interfaces which are more compatible with Moodle's curl.)
|
||||
3. Small fix to http_build_query() usages, to make sure the arg separator is explicitly set to '&', so as not to trip up
|
||||
on Moodle's definition of PHP's arg_separator.output which is set to '&' in lib/setup.php.
|
||||
4. The Packback\Lti1p3\ImsStorage\ImsCookie::setCookie() method has been locally patched to opt-in to Chrome cookie partitioning.
|
||||
|
||||
To upgrade to a new version of this library:
|
||||
1. Clone the latest version of the upstream library from github:
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Packback\Lti1p3\ImsStorage;
|
||||
|
||||
use auth_lti\local\ltiadvantage\utility\cookie_helper;
|
||||
use Packback\Lti1p3\Interfaces\ICookie;
|
||||
|
||||
class ImsCookie implements ICookie
|
||||
@ -33,6 +34,9 @@ class ImsCookie implements ICookie
|
||||
|
||||
setcookie($name, $value, array_merge($cookie_options, $same_site_options, $options));
|
||||
|
||||
// Necessary, since partitioned can't be set via setcookie yet.
|
||||
cookie_helper::add_attributes_to_cookie_response_header($name, ['Partitioned']);
|
||||
|
||||
// Set a second fallback cookie in the event that "SameSite" is not supported
|
||||
setcookie('LEGACY_'.$name, $value, array_merge($cookie_options, $options));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user