Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 2600ff6

Browse files
committed
A static client may not have keys of its own.
1 parent bc143ef commit 2600ff6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

flask_rp/application.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22

3+
from cryptojwt import KeyJar
34
from cryptojwt.key_jar import init_key_jar
45
from flask.app import Flask
56
from oidcop.utils import load_yaml_config
@@ -13,15 +14,18 @@ def init_oidc_rp_handler(app):
1314
oidc_keys_conf = app.config.get('OIDC_KEYS')
1415
verify_ssl = app.config.get('VERIFY_SSL')
1516

16-
_kj = init_key_jar(**oidc_keys_conf)
17+
if oidc_keys_conf:
18+
_kj = init_key_jar(**oidc_keys_conf)
19+
_path = oidc_keys_conf['public_path']
20+
if _path.startswith('./'):
21+
_path = _path[2:]
22+
elif _path.startswith('/'):
23+
_path = _path[1:]
24+
else:
25+
_kj = KeyJar()
26+
_path = ''
1727
_kj.verify_ssl = verify_ssl
1828

19-
_path = oidc_keys_conf['public_path']
20-
if _path.startswith('./'):
21-
_path = _path[2:]
22-
elif _path.startswith('/'):
23-
_path = _path[1:]
24-
2529
rph = RPHandler(base_url=app.config.get('BASEURL'), hash_seed="BabyHoldOn",
2630
keyjar=_kj, jwks_path=_path,
2731
client_configs=app.config.get('CLIENTS'),

0 commit comments

Comments
 (0)