Moodle and Keycloak: Profile picture not updated when changed in Keycloak

Moodle and Keycloak: Profile picture not updated when changed in Keycloak

by Jens Prymelski -
Number of replies: 0
Hi.

We have a problem with updating the profile picture in Moodle. When a custom attribute is updated in Keycloak,
changes are not visible in Moodle after the next login.
Keycloak provides this "picture" attribute within the user token, which gets mapped to "picture" in Keycloak in the
settings of the OAuth2 service.

What works:
New (OAuth2) users and users without a picture (also if the picture gets deleted in Moodle) get their profile picture by the link resource provided by Keycloak.

What not works:
The profile picture doest not get updated when a profile picture already exists.

Additional notes:
  • When the profile picture gets updated in Keycloak, this is not reflected in Moodle.
  • Logs on all related systems show no errors or problems.
  • The image from the updated link gets fetched (after Keycloak update and re-login) by the Moodle instance.
Side note:
Other (standard-) attributes get updated when changed in Keycloak, it's only this custom attribute which is problematic.
(There are no other custom attributes).

Does anyone have an idea?

Thanks in advance.
Greetings.

Average of ratings: -