matrix-org / matrix-synapse-ldap3

An LDAP3 auth provider for Synapse
Apache License 2.0
128 stars 46 forks source link

Avatar Support #108

Open Turakar opened 4 years ago

Turakar commented 4 years ago

I would enjoy the support for Avatars via the jpegPhoto attribute in LDAP. As far as I can tell there is no discussion on this yet. The design decisions by Nextcloud might be a good starting point. What are your thoughts on this?

nE0sIghT commented 4 years ago

As for now Synapse doesn't expose any method/property to obtain ProfileManager [1] from account_handler [2][3]. And we need ProfileManager to change avatar.
Technicaly we can use account_handler._hs.get_profile_handler(), but I don't think it will be acceptable PR... It's also not clear for me now how to store avatar since ProfileManager allows to set avatar URL only so image itself should be stored at HS somehow (so we need some more API calls).

Any Matrix devs here with some advice? Does usage of "private" account_handler._hs is acceptable?

[1] https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/profile.py#L38 [2] https://github.com/matrix-org/synapse/blob/develop/synapse/handlers/auth.py#L173 [3] https://github.com/matrix-org/synapse/blob/develop/synapse/module_api/__init__.py#L41

clokep commented 4 years ago

Any Matrix devs here with some advice? Does usage of "private" account_handler._hs is acceptable?

This would not be acceptable. I think we'd first need to do a PR to add the proper APIs to ModuleApi.. If we were to do this, we should probably also support display name at the same time since most of the code will be identical?

clokep commented 3 years ago

110 also mentions using "thumbnailPhoto (type: binary, image-type: jpeg)".

Half-Shot commented 3 years ago

This depends on https://github.com/matrix-org/synapse/issues/7734. While that issue mentions display names, it would presumably be trivial to also allow avatar updates too. In terms of uploading the media, we would need to consider how to work with external media repos as services like EMS do not use the Synapse media repo.

ankar84 commented 3 years ago

support for Avatars via the jpegPhoto attribute in LDAP

Definitely must have feature for such great project as Matrix!

helmut72 commented 2 years ago

LDAP support feels half complete, if users need to manually add their avatar.

xfn2020 commented 2 years ago

When expect avatar support?

soupglasses commented 1 year ago

The upstream OIDC now has to support for avatars. While url based, it could be of inspiration? https://github.com/matrix-org/synapse/issues/9357

eXtrem0us commented 1 year ago

Project Zulip has this option and it's written in Python3. It fetches the jpegPhoto (or any explicitly determined LDAP variable) with a LDAP variable-value map (a.k.a: AUTH_LDAP_USER_ATTR_MAP), same like as the attributes block in homeserver.yaml. Please take a look. I hope it would be useful. :)