Actually with further digging things are kinda working correctly as is but the issue comes about not from the LTI auth_remote_username username but from the fact that it tries to 'guess' what the parent auth's auth_remote_username remotename should be on user creation.
So as long as LMS username is the same username as the one SAML send to Mahara things will work as expected -- You received this bug notification because you are a member of Mahara Contributors, which is subscribed to Mahara. Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it! https://bugs.launchpad.net/bugs/1894773 Title: LTI not setting remoteusername correctly in some cases Status in Mahara: New Bug description: There is code that sets it to be passed in username and code to set it to be external user id value But it should just be remote username In LTI module_lti_launch.php we have the setting of values for the auth_remote_user table. on line 127 and 139 we set the $remoteusername then on line 183, when we are auto creating a user, we set the $user->username with this $remoteusername then on line 200 we set the remote user name as $authremoteuser->remoteusername = $user->username; but if we are not creating a new user but updating an existing one we get to the $updateremote part on line 235 and here we set the $authremoteuser->remoteusername as $params['user_id']; but it should be actually what we matched on earlier, either on line 115 => $params['user_id'] 125 => $params['ext_user_username'] 133 => $params['lis_person_contact_email_primary'] In fact, instead of setting $updateremote = true we can set it to the $params value used and pass that to line 238 To manage notifications about this bug go to: https://bugs.launchpad.net/mahara/+bug/1894773/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~mahara-contributors Post to : [email protected] Unsubscribe : https://launchpad.net/~mahara-contributors More help : https://help.launchpad.net/ListHelp

