diff --git a/src/digid_eherkenning_oidc_generics/utils.py b/src/digid_eherkenning_oidc_generics/utils.py index 21deb9528b..6df6607daf 100644 --- a/src/digid_eherkenning_oidc_generics/utils.py +++ b/src/digid_eherkenning_oidc_generics/utils.py @@ -30,7 +30,7 @@ def lookup_config(request: HttpRequest) -> type[OpenIDConnectBaseConfig]: # config query param is set in `OIDCInit.get_extra_params` try: config = apps.get_model(request.GET.get("config", "")) - except LookupError as exc: + except (LookupError, ValueError) as exc: raise BadRequest("Could not look up the referenced config.") from exc # TODO: check if this can be spoofed: starting the flow with a particular config diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid/test_auth_procedure.py b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid/test_auth_procedure.py index 0bc1593627..8a9801ba23 100644 --- a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid/test_auth_procedure.py +++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid/test_auth_procedure.py @@ -75,7 +75,7 @@ def test_redirect_to_digid_oidc(self): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('digid_oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('digid_oidc:callback')}", ) with self.subTest("Return state setup"): diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid_machtigen/test_auth_procedure.py b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid_machtigen/test_auth_procedure.py index a804fd7cc9..4f460e7caf 100644 --- a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid_machtigen/test_auth_procedure.py +++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/digid_machtigen/test_auth_procedure.py @@ -89,7 +89,7 @@ def test_redirect_to_digid_machtigen_oidc(self): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('digid_machtigen_oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('digid_machtigen_oidc:callback')}", ) with self.subTest("Return state setup"): diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning/test_auth_procedure.py b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning/test_auth_procedure.py index 162d1dced4..6f373a0bd3 100644 --- a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning/test_auth_procedure.py +++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning/test_auth_procedure.py @@ -75,7 +75,7 @@ def test_redirect_to_eherkenning_oidc(self): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('eherkenning_oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('eherkenning_oidc:callback')}", ) with self.subTest("Return state setup"): diff --git a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning_bewindvoering/test_auth_procedure.py b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning_bewindvoering/test_auth_procedure.py index 3b00f84aae..4e60f304d4 100644 --- a/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning_bewindvoering/test_auth_procedure.py +++ b/src/openforms/authentication/contrib/digid_eherkenning_oidc/tests/eherkenning_bewindvoering/test_auth_procedure.py @@ -90,7 +90,7 @@ def test_redirect_to_eherkenning_bewindvoering_oidc(self): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('eherkenning_bewindvoering_oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('eherkenning_bewindvoering_oidc:callback')}", ) with self.subTest("Return state setup"): diff --git a/src/openforms/authentication/contrib/org_oidc/tests/test_auth_procedure.py b/src/openforms/authentication/contrib/org_oidc/tests/test_auth_procedure.py index b410571080..01edc80936 100644 --- a/src/openforms/authentication/contrib/org_oidc/tests/test_auth_procedure.py +++ b/src/openforms/authentication/contrib/org_oidc/tests/test_auth_procedure.py @@ -98,7 +98,7 @@ def test_redirect_to_org_oidc(self, *m): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('org-oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('org-oidc:callback')}", ) parsed = furl(self.client.session["oidc_login_next"]) @@ -251,7 +251,7 @@ def test_redirect_to_allowed_domain(self, *m): self.assertEqual(query_params["client_id"], "testclient") self.assertEqual( query_params["redirect_uri"], - f"http://testserver{reverse('org-oidc:oidc_authentication_callback')}", + f"http://testserver{reverse('org-oidc:callback')}", ) @override_settings( @@ -346,7 +346,7 @@ def test_callback_url_creates_logged_in_django_user( ) # go through mock OIDC - callback_url = reverse_plus("org-oidc:oidc_authentication_callback") + callback_url = reverse_plus("org-oidc:callback") session = self.client.session session["oidc_states"] = {"mock": {"nonce": "nonce"}}