Skip to content

Commit

Permalink
Add support for bootstrap->idws exchange with parenthood claim - chan…
Browse files Browse the repository at this point in the history
…ge naming from parenthood to parent_authority
  • Loading branch information
jsotrifork committed Oct 11, 2024
1 parent 9c0a923 commit f22ee72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/trifork/unsealed/BootstrapToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static enum OnBehalfOfClaimType {
PROCURATION("urn:dk:healthcare:saml:actThroughProcurationBy:cprNumberIdentifier:"),
WARD("urn:dk:healthcare:saml:actThrough:WardCustody:cprNumberIdentifier:"),
PARTLY_WARD("urn:dk:healthcare:saml:actThrough:PartlyWardCustody:cprNumberIdentifier:"),
PARENTHOOD("urn:dk:healthcare:saml:actThrough:ParentalCustody:cprNumberIdentifier:");
PARENT_AUTHORITY("urn:dk:healthcare:saml:actThrough:ParentalCustody:cprNumberIdentifier:");

public final String prefix;

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/trifork/unsealed/BootstrapTokenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ void canExchangeBootstrapTokenToIDWSTokenWithProcuration() throws Exception {
}

@Test
void canExchangeBootstrapTokenToIDWSTokenWithParenthood() throws Exception {
void canExchangeBootstrapTokenToIDWSTokenWithParentAuthority() throws Exception {
BootstrapToken bst = issuer.cpr("2811686517").issueForCitizen(); // Karl Bonde

IdentityToken idwsToken = bst.exchangeToIdentityToken("https://fmk", "2811686517", "0904128090", BootstrapToken.OnBehalfOfClaimType.PARENTHOOD);
IdentityToken idwsToken = bst.exchangeToIdentityToken("https://fmk", "2811686517", "0904128090", BootstrapToken.OnBehalfOfClaimType.PARENT_AUTHORITY);

// Extract priviledge attribibute, base64 decode it, and verify that our procuration cpr is there
Element attributeStatement = XmlUtil.getChild(idwsToken.assertion, NsPrefixes.saml,
Expand Down

0 comments on commit f22ee72

Please sign in to comment.