catalyst / moodle-auth_saml2

SAML done 100% in Moodle, fast, simple, secure
https://moodle.org/plugins/auth_saml2
70 stars 132 forks source link

Fully hydrate user account before creating it #715

Closed catalystfd closed 1 year ago

catalystfd commented 1 year ago

This prevents issues with plugins such as local welcome, where they cannot function correctly as the account is created with only minimal information such as the username.

This extracts the logic for extracting saml2 attributes out of the update function so both update and create can use it, and then fully hydrates a user object before calling user_create_user to create the moodle user object.

Password updating is set to true for the use case where a different auth plugin is being used that might support the password field.

I still need to test this against a test IDP before it's ready for final merge but opening now for any review comments.

danmarsden commented 1 year ago

+1 from me! - @dmitriim would be good to get your eyes on this before we merge it though - any chance you could please take a quick look too?