MDL-63994 auth_cas: Include the login token in the simulated login form

The CAS login process relies on the standard authenticate_user_login()
call to set up the user. So we need to inject the login token to pass
the validation.
This commit is contained in:
David Mudrák
2018-11-15 20:44:03 +01:00
parent f779e204ac
commit 31bfc01e9d
+2
View File
@@ -154,6 +154,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
$frm = new stdClass();
$frm->username = phpCAS::getUser();
$frm->password = 'passwdCas';
$frm->logintoken = \core\session\manager::get_login_token();
// Redirect to a course if multi-auth is activated, authCAS is set to CAS and the courseid is specified.
if ($this->config->multiauth && !empty($courseid)) {
@@ -167,6 +168,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
$frm = new stdClass();
$frm->username = 'guest';
$frm->password = 'guest';
$frm->logintoken = \core\session\manager::get_login_token();
return;
}