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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user