From 4d9b181c57e6714a99a9179ab03c18c3ec790958 Mon Sep 17 00:00:00 2001 From: Mathieu Leplatre Date: Mon, 4 Dec 2017 17:19:38 +0100 Subject: [PATCH] Fix demo with new OIDC conformant mode Since the `groups` are not sent in JWT payload anymore, Doorman returns a list of principals that only contains the userid. Ref #55 --- examples/python/server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/python/server.py b/examples/python/server.py index 09bfd31..8552081 100644 --- a/examples/python/server.py +++ b/examples/python/server.py @@ -60,8 +60,8 @@ def hello(): @authorized(resource="record", action="list") def records(): authz = _app_ctx_stack.top.authz - email_principal = authz["principals"][1] - records = Records.list(author=email_principal) + main_principal = authz["principals"][0] + records = Records.list(author=main_principal) return jsonify(records) @@ -88,8 +88,8 @@ def record(name): # Save content on PUT if request.method == "PUT": body = request.data.decode("utf-8") - email_principal = authz["principals"][1] - record = Records.save(name, body, email_principal) + main_principal = authz["principals"][0] + record = Records.save(name, body, main_principal) return jsonify(record)