From a5d2e6d6fa2c75ae8211c818537524e8c54c3129 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 11 Jan 2021 15:15:03 +0100 Subject: fix some minor incompatibilities between AuthHandler and MS-Connector in E-ID mode --- connector/pom.xml | 2 +- .../specific/connector/attributes/AuthBlockAttributeBuilder.java | 6 +++++- connector/src/main/resources/application.properties | 2 ++ .../connector/test/attributes/AuthBlockAttributeBuilderTest.java | 5 ++++- 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'connector') diff --git a/connector/pom.xml b/connector/pom.xml index 2484e542..36a6d9df 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -12,7 +12,7 @@ at.asitplus.eidas.ms_specific ms_specific_connector war - Connector Maven Webapp + MS-specific eIDAS Service http://maven.apache.org diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/attributes/AuthBlockAttributeBuilder.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/attributes/AuthBlockAttributeBuilder.java index be9f8862..1833f377 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/attributes/AuthBlockAttributeBuilder.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/attributes/AuthBlockAttributeBuilder.java @@ -22,6 +22,9 @@ package at.asitplus.eidas.specific.connector.attributes; import static at.gv.egiz.eaaf.core.api.data.ExtendedPvpAttributeDefinitions.EID_AUTHBLOCK_SIGNED_FRIENDLY_NAME; import static at.gv.egiz.eaaf.core.api.data.ExtendedPvpAttributeDefinitions.EID_AUTHBLOCK_SIGNED_NAME; +import java.nio.charset.StandardCharsets; +import java.util.Base64; + import org.apache.commons.lang3.StringUtils; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; @@ -48,7 +51,8 @@ public class AuthBlockAttributeBuilder implements IPvpAttributeBuilder { String authBlock = authData.getGenericData(Constants.SZR_AUTHBLOCK, String.class); if (StringUtils.isNotEmpty(authBlock)) { - return g.buildStringAttribute(EID_AUTHBLOCK_SIGNED_FRIENDLY_NAME, EID_AUTHBLOCK_SIGNED_NAME, authBlock); + return g.buildStringAttribute(EID_AUTHBLOCK_SIGNED_FRIENDLY_NAME, EID_AUTHBLOCK_SIGNED_NAME, + Base64.getEncoder().encodeToString(authBlock.getBytes(StandardCharsets.UTF_8))); } else { throw new UnavailableAttributeException(EID_AUTHBLOCK_SIGNED_NAME); diff --git a/connector/src/main/resources/application.properties b/connector/src/main/resources/application.properties index ef83d435..b13b6c18 100644 --- a/connector/src/main/resources/application.properties +++ b/connector/src/main/resources/application.properties @@ -70,6 +70,7 @@ eidas.ms.auth.eIDAS.szrclient.timeout.response=30 eidas.ms.auth.eIDAS.szrclient.params.vkz= eidas.ms.auth.eIDAS.szrclient.params.useSZRForbPKCalculation=false +eidas.ms.auth.eIDAS.szrclient.eidasbind.mds.inject=false # tech. AuthBlock signing for E-ID process @@ -84,6 +85,7 @@ eidas.ms.auth.eIDAS.szrclient.params.useSZRForbPKCalculation=false #Raw eIDAS Id data storage eidas.ms.auth.eIDAS.szrclient.workarounds.eidmapping.revisionlog.active=true + eidas.ms.auth.eIDAS.szrclient.params.setPlaceOfBirthIfAvailable=true eidas.ms.auth.eIDAS.szrclient.params.setBirthNameIfAvailable=true diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/attributes/AuthBlockAttributeBuilderTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/attributes/AuthBlockAttributeBuilderTest.java index f6d22c98..5c0a1420 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/attributes/AuthBlockAttributeBuilderTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/attributes/AuthBlockAttributeBuilderTest.java @@ -2,6 +2,8 @@ package at.asitplus.eidas.specific.connector.test.attributes; import static at.gv.egiz.eaaf.core.api.data.ExtendedPvpAttributeDefinitions.EID_AUTHBLOCK_SIGNED_NAME; +import java.util.Base64; + import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -64,7 +66,8 @@ public class AuthBlockAttributeBuilderTest extends AbstractAttributeBuilderTest final String value = attrBuilde.build(spConfig, authData, gen); - Assert.assertEquals("Authblock build wrong", JSW, value); + Assert.assertNotNull("AuthBlock", value); + Assert.assertEquals("Authblock build wrong", JSW, new String(Base64.getDecoder().decode(value))); } catch (final Exception e) { Assert.assertNull("Attr. builder has an exception", e); -- cgit v1.2.3