matrix-synapse/rootfs/py-pkgs/nextcloud_oicd_mapping_provider.py

23 lines
676 B
Python
Raw Normal View History

from synapse.handlers.oidc import OidcMappingProvider
2020-12-11 09:07:43 +00:00
class NextcloudOidcMappingProvider(OidcMappingProvider):
def __init__(self, config):
self._config = config
@staticmethod
def parse_config(config):
return {}
def get_remote_user_id(self, userinfo):
return userinfo["ocs"]["data"]["id"]
async def map_user_attributes(self, userinfo, token):
localpart = userinfo["ocs"]["data"]["id"]
display_name = userinfo["ocs"]["data"]["display-name"]
return {"localpart": localpart, "display_name": display_name}
async def get_extra_attributes(self, userinfo, token):
extras = {}
return extras