Skip to content

Conversation

@helmo-nico
Copy link

@helmo-nico helmo-nico commented Oct 2, 2025

The issue was this:

  1. In Moodle, configure:
  • "auth_oidc | field_map_idnumber" to "employeeId"
  • "auth_oidc | field_updatelocal_idnumber" to "always"
  1. In Entra ID, bind the employeeId so it's returned in the token.

  2. During authentication, the get_userinfo($username) function retrieves the token and extracts several pieces of information, but not the employeeId.

  3. The apply_configured_fieldmap_from_token(array $userdata, string $eventtype) function receives these partial user data, and since employeeId is missing from $userdata, it cannot be updated.

My patch does the following:

Map employee_id from token claims when not set. Enables binding employee_id to user data based on auth_oidc_field_mapping configuration.

By adding employeeId handling to the get_userinfo($username) function, the idnumber field now updates correctly during user login, in accordance with the administrator's configuration.

Map employee_id from token claims when not set. Enables binding employee_id to user data based on auth_oidc_field_mapping configuration.
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.

1 participant