From f22ee720f1e4c0cf0c233f36c686d0653745be30 Mon Sep 17 00:00:00 2001 From: Jeppe Sommer Date: Fri, 11 Oct 2024 13:15:03 +0200 Subject: [PATCH] Add support for bootstrap->idws exchange with parenthood claim - change naming from parenthood to parent_authority --- src/main/java/com/trifork/unsealed/BootstrapToken.java | 2 +- src/test/java/com/trifork/unsealed/BootstrapTokenTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/trifork/unsealed/BootstrapToken.java b/src/main/java/com/trifork/unsealed/BootstrapToken.java index 6e00de0..a605ff1 100755 --- a/src/main/java/com/trifork/unsealed/BootstrapToken.java +++ b/src/main/java/com/trifork/unsealed/BootstrapToken.java @@ -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; diff --git a/src/test/java/com/trifork/unsealed/BootstrapTokenTest.java b/src/test/java/com/trifork/unsealed/BootstrapTokenTest.java index 1ca5d9f..06778cd 100755 --- a/src/test/java/com/trifork/unsealed/BootstrapTokenTest.java +++ b/src/test/java/com/trifork/unsealed/BootstrapTokenTest.java @@ -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,