Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spid backend acr selection #135

Merged
merged 5 commits into from
Mar 27, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions example/backends/spidsaml2.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,23 @@ def authn_response(self, context, binding):
recipient = _sp_config["service"]["sp"]["endpoints"][
"assertion_consumer_service"
][0][0]
authn_context_classref = self.config["acr_mapping"][""]

issuer = authn_response.response.issuer
# ACR
issuer = authn_response.response.issuer.text.strip()
acr_map :dict = {}

try:
acr_map = self.config["acr_mapping"]
except Exception as e:
logger.warning(
"acr_mapping not defined in the spid backend"
)
return self.handle_error(
**{"message": "acr_mapping not defined in the spid backend",
"troubleshoot": "Please contact the administrators of the platform and tell them to configure properly the acr_mapping in the SPID/CIE backend"}
peppelinux marked this conversation as resolved.
Show resolved Hide resolved
)
acr_default = acr_map.get("", "https://www.spid.gov.it/SpidL2")
authn_context_classref = acr_map.get(issuer, acr_default)

# this will get the entity name in state
if len(context.state.keys()) < 2:
Expand Down
Loading