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

feat: add fallback idp/mdl attribute mapping #840

Open
wants to merge 1 commit into
base: MOODLE_39_STABLE
Choose a base branch
from

Conversation

keevan
Copy link
Contributor

@keevan keevan commented Nov 4, 2024

Used when the primary mapping does not match against any particular
user. This can be used in the case where attributes used for id
management are transitioned from one field to another, and allows for a
gradual non-disruptive rollover.

New settings (below 'Case matching'):
image

The example used locally was against the idnumber field. Any other moodle field could work also, such as username, email, alt name.

Local env comments:
To see the id number field, one needs to check the "ID Number" field here under the showuseridentity setting:
image

@keevan keevan marked this pull request as draft November 4, 2024 06:12
@keevan keevan force-pushed the fallback-idp-mdl-attr-mapping branch from 2024110 to 2024110 Compare November 4, 2024 06:45
@keevan keevan marked this pull request as ready for review November 4, 2024 06:45
@keevan keevan linked an issue Nov 6, 2024 that may be closed by this pull request
Used when the primary mapping does not match against any particular
user. This can be used in the case where attributes used for id
management are transitioned from one field to another, and allows for a
gradual non-disruptive rollover.
@keevan keevan force-pushed the fallback-idp-mdl-attr-mapping branch from 2024110 to 2024110 Compare November 6, 2024 04:15
@Peterburnett
Copy link
Contributor

@keevan I think we just need to do a bit of adjustment to the field updated function here:

https://github.com/catalyst/moodle-auth_saml2/blob/MOODLE_39_STABLE/classes/auth.php#L1030

When you get logged in via a secondary mapping, this would not update your primary field, and will emit some debugging. We should allow this overwrite in the cases where a secondary mapping is configured. Please update this and add a test for this scenario.

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

Successfully merging this pull request may close these issues.

Add (optional) secondary idp/mdl attribute mapping
2 participants