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

docs: sso.update_profile_information also supports synchronising the picture (avatar) claim #17836

Open
micolous opened this issue Oct 16, 2024 · 1 comment

Comments

@micolous
Copy link

matrix-org/synapse#13917 added support for synchronising the user's avatar based on an OIDC picture claim.

It appears that this can be automatically synchronised on every login when sso.update_profile_information = true:

elif self._sso_update_profile_information:
attributes = await self._call_attribute_mapper(sso_to_matrix_id_mapper)
if attributes.display_name:
user_id_obj = UserID.from_string(user_id)
profile_display_name = await self._profile_handler.get_displayname(
user_id_obj
)
if profile_display_name != attributes.display_name:
requester = create_requester(
user_id,
authenticated_entity=user_id,
)
await self._profile_handler.set_displayname(
user_id_obj, requester, attributes.display_name, True
)
if attributes.picture:
await self.set_avatar(user_id, attributes.picture)

However, the update_profile_information docs state that only "displayname" is supported:

* `update_profile_information`: Use this setting to keep a user's profile fields in sync with information from
the identity provider. Currently only syncing the displayname is supported. Fields

This should mention that avatars are also supported.

@sandhose
Copy link
Member

Good catch! The profile picture claim import has a few caveats, like the fact that it only really work in non-workerized deployments, and doesn't work with external media repositories, which might be why this has been forgotten in the docs.

Nonetheless, this should be updated, so feel free to open a PR to fix this!

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

No branches or pull requests

2 participants