Skip to content

Commit

Permalink
Merge pull request #4630 from open-formulieren/fix/4627-eherkenning-o…
Browse files Browse the repository at this point in the history
…idc-acting-subject-claim

[#4627] Fix acting_subject_claim KeyError in eHerkenning via OIDC
  • Loading branch information
sergei-maertens authored Sep 2, 2024
2 parents 262d84e + f54f7cd commit 2139625
Show file tree
Hide file tree
Showing 3 changed files with 391 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class EHClaims(TypedDict):

identifier_type_claim: NotRequired[str]
legal_subject_claim: str
acting_subject_claim: str
acting_subject_claim: NotRequired[str]
branch_number_claim: NotRequired[str]
# *could* be a number if no value mapping is specified and the source claims return
# numeric values...
Expand Down Expand Up @@ -219,9 +219,9 @@ def transform_claims(self, normalized_claims: EHClaims) -> FormAuth:
"value": normalized_claims["legal_subject_claim"],
"loa": str(normalized_claims.get("loa_claim", "")),
"acting_subject_identifier_type": "opaque",
"acting_subject_identifier_value": normalized_claims[
"acting_subject_claim"
],
"acting_subject_identifier_value": normalized_claims.get(
"acting_subject_claim", ""
),
}
if service_restriction := normalized_claims.get("branch_number_claim", ""):
form_auth["legal_subject_service_restriction"] = service_restriction
Expand Down
Loading

0 comments on commit 2139625

Please sign in to comment.