diff --git a/example/flask_op/config.json b/example/flask_op/config.json index 654662d5..c664cb55 100644 --- a/example/flask_op/config.json +++ b/example/flask_op/config.json @@ -278,9 +278,8 @@ ] } ], - "public_path": "static/jwks.json", "read_only": false, - "uri_path": "static/jwks.json" + "uri_path": "jwks.json" }, "login_hint2acrs": { "class": "idpyoidc.server.login_hint.LoginHint2Acrs", @@ -350,6 +349,6 @@ "verify_user": false, "port": 5000, "domain": "127.0.0.1", - "debug": true + "debug": false } } diff --git a/example/flask_op/private/cookie_jwks.json b/example/flask_op/private/cookie_jwks.json index dd515ec4..87182daf 100644 --- a/example/flask_op/private/cookie_jwks.json +++ b/example/flask_op/private/cookie_jwks.json @@ -1 +1 @@ -{"keys": [{"kty": "oct", "use": "enc", "kid": "enc", "k": "GEmhZ9UKLSq60zECQRyAtmMLG5smRpCl"}, {"kty": "oct", "use": "sig", "kid": "sig", "k": "Px8EGB-oWk-DfMlYWXBHTjED372mvtBt"}]} \ No newline at end of file +{"keys": [{"kty": "oct", "use": "enc", "kid": "enc", "k": "0lC9NQ6myQhLrrXuwD8u2JbLUYeJtbHl"}, {"kty": "oct", "use": "sig", "kid": "sig", "k": "laZeHjJYdltDAsV1M0Ke2Ct1of2qK1I1"}]} \ No newline at end of file diff --git a/example/flask_op/static/jwks.json b/example/flask_op/static/jwks.json index 2ac9940a..e6dc3e44 100644 --- a/example/flask_op/static/jwks.json +++ b/example/flask_op/static/jwks.json @@ -1 +1 @@ -{"keys": [{"kty": "RSA", "use": "sig", "kid": "bXNmZXROQ3N2dDI2SWY5VlNWTG5yOXZqYlpLenVsalhwUWR5RW9BMHNCaw", "e": "AQAB", "n": "uGVI-b6qr-OTc2knp7bpmDtiCQoWFXZ8mUV-SX0rCMtcc_IRmc_J7AfNEfnYk3dv0cKQK_Dgv3vicoeuf4KQ9ZZY-xI3bnRl9_HnhRpz_cJScDirkNKlsv8aQuYBO_gIiHp8B32YC0nx3BUQV5I6QGEiyG-lZT9PmXsUO1uKPPhny_vtQ6cUpvtuLySBu2ZYpaTDQqCv5Y6EKC49NYWhBB4B6f6TNKCoQTaxA8ZoM3lh7kFbu5DPEXKFAtuNiOtUNP7Ei9KfBtyBYSaZQBY8VkwAm1yKCA2sfv1mBwx0dT53MPJlNkoltf89mv1NM2OJPQAgGE6ygwGS2fyBLAn_bQ"}, {"kty": "EC", "use": "sig", "kid": "U0pLNmFBRE4waDYyZG9ZdjNPb2pTZXAwZzdrbmpZdG0ya3lpaFJwZU9ncw", "crv": "P-256", "x": "DYUyBfiD53SEtUuKLjFCFpIkqyhbmBppAMjOat9qiY0", "y": "-SUSvVeOv7EA84qHLLEkDP24iZree-fomICuA4baeeA"}]} \ No newline at end of file +{"keys": [{"kty": "RSA", "use": "sig", "kid": "bXNmZXROQ3N2dDI2SWY5VlNWTG5yOXZqYlpLenVsalhwUWR5RW9BMHNCaw", "n": "uGVI-b6qr-OTc2knp7bpmDtiCQoWFXZ8mUV-SX0rCMtcc_IRmc_J7AfNEfnYk3dv0cKQK_Dgv3vicoeuf4KQ9ZZY-xI3bnRl9_HnhRpz_cJScDirkNKlsv8aQuYBO_gIiHp8B32YC0nx3BUQV5I6QGEiyG-lZT9PmXsUO1uKPPhny_vtQ6cUpvtuLySBu2ZYpaTDQqCv5Y6EKC49NYWhBB4B6f6TNKCoQTaxA8ZoM3lh7kFbu5DPEXKFAtuNiOtUNP7Ei9KfBtyBYSaZQBY8VkwAm1yKCA2sfv1mBwx0dT53MPJlNkoltf89mv1NM2OJPQAgGE6ygwGS2fyBLAn_bQ", "e": "AQAB"}, {"kty": "EC", "use": "sig", "kid": "U0pLNmFBRE4waDYyZG9ZdjNPb2pTZXAwZzdrbmpZdG0ya3lpaFJwZU9ncw", "crv": "P-256", "x": "DYUyBfiD53SEtUuKLjFCFpIkqyhbmBppAMjOat9qiY0", "y": "-SUSvVeOv7EA84qHLLEkDP24iZree-fomICuA4baeeA"}]} \ No newline at end of file diff --git a/example/flask_op/views.py b/example/flask_op/views.py index 7846af50..bd7c75d2 100644 --- a/example/flask_op/views.py +++ b/example/flask_op/views.py @@ -54,6 +54,12 @@ def keys(jwks): fname = os.path.join('static', jwks) return open(fname).read() +@oidc_op_views.route('/jwks.json') +def jwks(): + _context = current_app.server.get_context() + _jwks = _context.keyjar.export_jwks() + return _jwks + @oidc_op_views.route('/') def index():