Skip to content

Commit

Permalink
Append @pres_req_conf_id to sub
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Jaeger-Freeborn <[email protected]>
  • Loading branch information
Gavinok committed Oct 8, 2024
1 parent 7ba6ba3 commit a07f986
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion oidc-controller/api/core/oidc/issue_token_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,14 @@ def get_claims(

if sub_id_claim:
# add sub and append presentation_claims
oidc_claims.append(Claim(type="sub", value=sub_id_claim.value))
assert type(auth_session.request_parameters["pres_req_conf_id"]) == str
oidc_claims.append(
Claim(
type="sub",
value=f"{sub_id_claim.value}@{auth_session.request_parameters['pres_req_conf_id']}",
)
)

elif ver_config.generate_consistent_identifier:
# Do not create a sub based on the proof claims if the
# user requests a generated identifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async def test_valid_presentation_with_matching_subject_identifier_in_claims_sub
auth_session.presentation_exchange = presentation["by_format"]
claims = Token.get_claims(auth_session, ver_config)
print(claims)
assert claims["sub"] == "[email protected]"
assert claims["sub"] == "[email protected]@verified-email"


@pytest.mark.asyncio
Expand Down

0 comments on commit a07f986

Please sign in to comment.