From aad8b5526683e1dd4785cbdc0f013d3439c987b4 Mon Sep 17 00:00:00 2001 From: Nikos Sklikas Date: Wed, 11 Mar 2020 13:18:50 +0200 Subject: [PATCH] Move keyjar init Keyjar should be initialized before the creation of the token handler, because it is passed to the token handlers. --- src/oidcendpoint/endpoint_context.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/oidcendpoint/endpoint_context.py b/src/oidcendpoint/endpoint_context.py index eed7c75..a1d8e65 100755 --- a/src/oidcendpoint/endpoint_context.py +++ b/src/oidcendpoint/endpoint_context.py @@ -103,6 +103,10 @@ def __init__( self.keyjar = keyjar or KeyJar() self.cwd = cwd + if self.keyjar is None or self.keyjar.owners() == []: + args = {k: v for k, v in conf["jwks"].items() if k != "uri_path"} + self.keyjar = init_key_jar(**args) + try: self.seed = bytes(conf["seed"], "utf-8") except KeyError: @@ -199,10 +203,6 @@ def __init__( except KeyError: self.jwks_uri = "" - if self.keyjar is None or self.keyjar.owners() == []: - args = {k: v for k, v in conf["jwks"].items() if k != "uri_path"} - self.keyjar = init_key_jar(**args) - for item in [ "cookie_dealer", "authz",