From 3dac7e922664d3467fd5f3bc4b919371e8d683e8 Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 10 May 2024 10:18:07 -0400 Subject: [PATCH] update token expiry for test openid server --- .../routes/openid_blueprint/openid_blueprint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py index 96ce108d1..ac00c2b9e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/openid_blueprint/openid_blueprint.py @@ -123,12 +123,17 @@ def token() -> Response | dict: host_url = _host_url_without_root_path() private_key = OpenIdConfigsForDevOnly.private_key + # this is just for testing. there is no need to expire tokens rapidly. + one_hour = 3600 + one_day = one_hour * 24 + two_days = one_day * 2 + id_token = jwt.encode( { "iss": f"{host_url}{url_for('openid.index')}", "aud": client_id, "iat": math.floor(time.time()), - "exp": round(time.time()) + 3600, + "exp": round(time.time()) + two_days, "sub": user_name, "email": user_details["email"], "preferred_username": user_details.get("preferred_username", user_name),