Skip to content

Commit 789beed

Browse files
tensor5peppelinux
andauthored
feat: make request ACS index configurable (#190)
* feat: make request ACS index configurable * Apply suggestions from code review --------- Co-authored-by: Giuseppe De Marco <demarcog83@gmail.com>
1 parent 9a93c20 commit 789beed

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

example/backends/spidsaml2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ def authn_request(self, context, entity_id):
381381
# spid-testenv2 preleva l'attribute consumer service dalla authnRequest
382382
# (anche se questo sta già nei metadati...)
383383
# Imposta il consuming_service_index in base al default di ficep per le richieste ficep, oppure a '0' per le richieste spid
384-
if entity_id == self.config["sp_config"]["ficep_entity_id"]:
385-
authn_req.attribute_consuming_service_index = str(self.config["sp_config"]["ficep_default_acs_index"])
386-
else:
387-
authn_req.attribute_consuming_service_index = "0"
388-
384+
authn_req.attribute_consuming_service_index = str(
385+
self.config["sp_config"].get("acs_index") or
386+
self.config["sp_config"].get("ficep_default_acs_index") or
387+
"0"
388+
)
389389
issuer = saml2.saml.Issuer()
390390
issuer.name_qualifier = client.config.entityid
391391
issuer.text = client.config.entityid

example/plugins/backends/spidsaml2_backend.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ config:
7676
entityid: '<base_url>/<name>/metadata'
7777
accepted_time_diff: 10
7878

79+
# Specify the AttributeConsumingServiceIndex attribute in the request (default 0).
80+
# acs_index: 0
81+
7982
service:
8083
sp:
8184
ui_info:

0 commit comments

Comments
 (0)