Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAML2-SSO using autocreate is not tenant aware #1978

Open
tom5850 opened this issue Apr 27, 2024 · 0 comments
Open

SAML2-SSO using autocreate is not tenant aware #1978

tom5850 opened this issue Apr 27, 2024 · 0 comments

Comments

@tom5850
Copy link

tom5850 commented Apr 27, 2024

Using SAML2-SSO with activated autocreate, creates a new user always without tenant information.

That's because in iomadsaml2/classes/auth.php, line 748 the moodle core function is called, which is not aware of tenants:

$user->id = \user_create_user($user, true, true);

I suggest to replace this line with:
$companyid = iomad::get_my_companyid(context_system::instance(), false);
$user->companyid = $companyid;
$user->id = \company_user::create($user);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant