From 278e1be7192d8058544aaa0894b08a5decbca0b9 Mon Sep 17 00:00:00 2001 From: Giuseppe De Marco Date: Wed, 13 Mar 2024 11:25:27 +0100 Subject: [PATCH] spid backend acr selection --- example/backends/spidsaml2.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/example/backends/spidsaml2.py b/example/backends/spidsaml2.py index c5f06a42..47b3a30e 100644 --- a/example/backends/spidsaml2.py +++ b/example/backends/spidsaml2.py @@ -565,7 +565,14 @@ def authn_response(self, context, binding): # ACR issuer = authn_response.response.issuer - acr_map = self.config.get("acr_mapping", {}) + acr_map :dict = {} + + try: + acr_map = self.config["acr_mapping"] + except Exception as e: + logger.warning( + "acr_mapping not defined in the spid backend" + ) acr_default = acr_map.get("", "https://www.spid.gov.it/SpidL2") authn_context_classref = acr_map.get(issuer, acr_default)