From 850c7faafe48aa3f928955023a469cad9196fc17 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Oct 11 2016 13:37:11 +0000 Subject: Fix OpenID Connect client updating Signed-off-by: Patrick Uiterwijk Reviewed-by: Pierre-Yves Chibon --- diff --git a/ipsilon/providers/openidc/admin.py b/ipsilon/providers/openidc/admin.py index fb4bf5d..b4a70d6 100644 --- a/ipsilon/providers/openidc/admin.py +++ b/ipsilon/providers/openidc/admin.py @@ -106,7 +106,7 @@ class ClientAdminPage(AdminPage): (name, value), severity=logging.DEBUG) new_db_values[name] = value - client_id = kwargs['Client ID'] + client_id = kwargs.get('Client ID') if self.new_client and client_id: if re.search(INVALID_IN_CLIENT_ID, client_id): message = 'Invalid character in client ID' diff --git a/ipsilon/providers/openidc/store.py b/ipsilon/providers/openidc/store.py index 9e0a315..21d5354 100644 --- a/ipsilon/providers/openidc/store.py +++ b/ipsilon/providers/openidc/store.py @@ -62,8 +62,8 @@ class OpenIDCStore(Store): del client['ipsilon_internal']['client_id'] info = {} - for key, datum in client: - info[key] = json.loads(datum) + for key in client: + info[key] = json.dumps(client[key]) if client_id.startswith('D-'): # This is a dynamically registered client @@ -71,7 +71,7 @@ class OpenIDCStore(Store): self.save_unique_data('client', {client_id: info}) else: # This is a statically configured client - self.static_store.save_options('client', {client_id: info}) + self.static_store.save_options('client', client_id, info) def getDynamicClients(self): clients = {}