diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 3df4ee25..5766156a 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -97,6 +97,7 @@ class DevicehubConfig(Config): MAIL_DEFAULT_SENDER = config('MAIL_DEFAULT_SENDER', '') API_DLT = config('API_DLT', None) API_DLT_TOKEN = config('API_DLT_TOKEN', None) + ID_FEDERATED = config('ID_FEDERATED', None) """Definition of oauth jwt details.""" OAUTH2_JWT_ENABLED = config('OAUTH2_JWT_ENABLED', False) diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py index 0c1d32a4..06e0994b 100644 --- a/ereuse_devicehub/resources/device/models.py +++ b/ereuse_devicehub/resources/device/models.py @@ -972,6 +972,9 @@ class Device(Thing): if isinstance(c, DataStorage): c.register_dlt() + if app.config('ID_FEDERATED'): + api.add_service(self.chid, 'devicehub', app.config('ID_FEDERATED'), '', '') + def unreliable(self): self.user_trusts = False i = 0