diff options
Diffstat (limited to 'connector/src')
17 files changed, 765 insertions, 578 deletions
diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java deleted file mode 100644 index b4d58cdd..00000000 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/config/StaticResourceConfiguration.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Copyright 2019 A-SIT Plus GmbH - * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, - * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "License"); - * You may not use this work except in compliance with the License. - * You may obtain a copy of the License at: - * https://joinup.ec.europa.eu/news/understanding-eupl-v12 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - -package at.asitplus.eidas.specific.connector.config; - -import java.net.MalformedURLException; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.ReloadableResourceBundleMessageSource; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.i18n.CookieLocaleResolver; -import org.thymeleaf.templateresolver.FileTemplateResolver; - -import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; -import at.gv.egiz.eaaf.core.api.idp.IConfiguration; -import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; -import at.gv.egiz.eaaf.core.impl.utils.FileUtils; - -/** - * Spring configurator for Web resources. - * - * @author tlenz - * - */ -@Configuration -public class StaticResourceConfiguration implements WebMvcConfigurer { - private static final Logger log = LoggerFactory.getLogger(StaticResourceConfiguration.class); - private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { - "/" - }; - - private static final String DEFAULT_MESSAGE_SOURCE = "classpath:properties/status_messages"; - - @Autowired - private IConfiguration basicConfig; - - @Override - public void addResourceHandlers(ResourceHandlerRegistry registry) { - final String staticResources = basicConfig.getBasicConfiguration( - MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_STATIC_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - String absPath = FileUtils.makeAbsoluteUrl(staticResources, basicConfig - .getConfigurationRootDirectory()); - if (!absPath.endsWith("/")) { - absPath += "/"; - } - - registry.addResourceHandler("/static/**").addResourceLocations(absPath); - log.info("Add Ressourcefolder: " + absPath + " for static Web content"); - - } else { - log.debug("No Ressourcefolder for static Web content"); - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for static Web content", e); - - } - - registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); - - } - - /** - * Get a message source with only internal message properties. - * - * @param ressourceLocations List of source-locations - * @return - */ - @Bean - public ReloadableResourceBundleMessageSource internalMessageSource( - @Autowired(required = false) final List<IMessageSourceLocation> ressourceLocations) { - final ReloadableResourceBundleMessageSource messageSource = - new ReloadableResourceBundleMessageSource(); - - // add default message source - messageSource.setBasename(DEFAULT_MESSAGE_SOURCE); - - if (ressourceLocations != null) { - // load more message sources - for (final IMessageSourceLocation el : ressourceLocations) { - if (el.getMessageSourceLocation() != null) { - for (final String source : el.getMessageSourceLocation()) { - messageSource.addBasenames(source); - log.debug("Add additional messageSources: {}", el.getMessageSourceLocation().toArray()); - - } - } - } - } - - messageSource.setDefaultEncoding("UTF-8"); - return messageSource; - - } - - /** - * Get full message source with internal and external message-properties files. - * - * @param ressourceLocations List of source-locations - * @return - */ - @Bean - public ReloadableResourceBundleMessageSource messageSource( - @Autowired(required = false) final List<IMessageSourceLocation> ressourceLocations) { - final ReloadableResourceBundleMessageSource messageSource = - new ReloadableResourceBundleMessageSource(); - messageSource.setDefaultEncoding("UTF-8"); - messageSource.setParentMessageSource(internalMessageSource(ressourceLocations)); - - final String staticResources = basicConfig - .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_PROPERTIES_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - final String absPath = - FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); - messageSource.setBasename(absPath); - - } else { - log.debug("No Ressourcefolder for dynamic Web content templates"); - - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); - - } - - return messageSource; - - } - - /** - * Get a i18n resolver based on cookies. - * - * @return - */ - @Bean - public CookieLocaleResolver localeResolver() { - final CookieLocaleResolver localeResolver = new CookieLocaleResolver(); - localeResolver.setCookieName("currentLanguage"); - localeResolver.setCookieMaxAge(3600); - return localeResolver; - - } - - /** - * Get a Tyhmeleaf Template-Resolver with external configuration path. - * - * @return - */ - @Bean(name = "templateResolver") - public FileTemplateResolver templateResolver() { - final String staticResources = basicConfig - .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_TEMPLATES_PATH); - try { - if (StringUtils.isNotEmpty(staticResources)) { - String absPath = - FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); - if (!absPath.endsWith("/")) { - absPath += "/"; - - } - - if (absPath.startsWith("file:")) { - absPath = absPath.substring("file:".length()); - - } - - final FileTemplateResolver viewResolver = new FileTemplateResolver(); - viewResolver.setPrefix(absPath); - viewResolver.setSuffix(".html"); - viewResolver.setTemplateMode("HTML"); - viewResolver.setCacheable(false); - - log.info("Add Ressourcefolder: {} for dynamic Web content templates", absPath); - return viewResolver; - - } else { - log.debug("No Ressourcefolder for dynamic Web content templates"); - - } - - } catch (final MalformedURLException e) { - log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); - - } - - throw new RuntimeException("Can NOT initialize HTML template resolver"); - - } -} diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java index 1bf1ad67..6e2879a8 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/controller/ProcessEngineSignalController.java @@ -46,7 +46,8 @@ import at.gv.egiz.eaaf.core.impl.idp.controller.AbstractProcessEngineSignalContr public class ProcessEngineSignalController extends AbstractProcessEngineSignalController { @RequestMapping(value = { - MsEidasNodeConstants.ENDPOINT_COUNTRYSELECTION + MsEidasNodeConstants.ENDPOINT_COUNTRYSELECTION, + MsEidasNodeConstants.ENDPOINT_OTHER_LOGIN_METHOD_SELECTION }, method = { RequestMethod.POST, RequestMethod.GET }) public void performGenericAuthenticationProcess(HttpServletRequest req, HttpServletResponse resp) diff --git a/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java b/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java index e83d9d49..eef09b8d 100644 --- a/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java +++ b/connector/src/main/java/at/asitplus/eidas/specific/connector/provider/StatusMessageProvider.java @@ -29,16 +29,15 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; import at.gv.egiz.eaaf.core.api.IStatusMessenger; import at.gv.egiz.eaaf.core.exceptions.EaafException; +import lombok.extern.slf4j.Slf4j; @Service("StatusMessageProvider") +@Slf4j public class StatusMessageProvider implements IStatusMessenger { - private static final Logger log = LoggerFactory.getLogger(StatusMessageProvider.class); private static final String ERROR_MESSAGES_UNAVAILABLE = "Error messages can NOT be load from application. Only errorCode: {0} is availabe"; @@ -93,13 +92,11 @@ public class StatusMessageProvider implements IStatusMessenger { @Override public String getResponseErrorCode(Throwable throwable) { - String errorCode = IStatusMessenger.CODES_EXTERNAL_ERROR_GENERIC; if (throwable instanceof EaafException) { - errorCode = ((EaafException) throwable).getErrorId(); - + return ((EaafException) throwable).getErrorId(); + } - - return errorCode; + return IStatusMessenger.CODES_INTERNAL_ERROR_GENERIC; } diff --git a/connector/src/main/resources/application.properties b/connector/src/main/resources/application.properties index 73a83c13..e92099ab 100644 --- a/connector/src/main/resources/application.properties +++ b/connector/src/main/resources/application.properties @@ -96,6 +96,22 @@ eidas.ms.auth.eIDAS.szrclient.eidasbind.mds.inject=false #eidas.ms.auth.eIDAS.authblock.key.password=f/+saJBc3a}*/T^s + +#### matching###### +# ZMR communication +#eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +#eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +#eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +#eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +#eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 +#eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT +#eidas.ms.auth.eIDAS.zmrclient.req.update.reason.text=KITT for eIDAS Matching + + + #Raw eIDAS Id data storage eidas.ms.auth.eIDAS.szrclient.workarounds.eidmapping.revisionlog.active=true diff --git a/connector/src/main/resources/properties/status_messages_en.properties b/connector/src/main/resources/properties/status_messages_en.properties index 80228a47..f07a8705 100644 --- a/connector/src/main/resources/properties/status_messages_en.properties +++ b/connector/src/main/resources/properties/status_messages_en.properties @@ -5,7 +5,8 @@ eidas.03=No CitizenCountry available. Can not start eIDAS authentication process eidas.04=Request contains no sessionToken. Authentication process stops eidas.05=Received eIDAS response-message is not valid. Reason: {0} eidas.06=LoA from eIDAS response-message {0} does not match to requested LoA -eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1} +eidas.07=eIDAS Response attribute-validation FAILED. Attribute:{0} Reason: {1}. + config.01=No configuration-file parameter found. Maybe Java SystemD parameter is missing config.03=Can not load configuration from path {0} (See logs for more details) diff --git a/connector/src/main/resources/specific_eIDAS_connector.beans.xml b/connector/src/main/resources/specific_eIDAS_connector.beans.xml index df2a9aa4..ec16a7d2 100644 --- a/connector/src/main/resources/specific_eIDAS_connector.beans.xml +++ b/connector/src/main/resources/specific_eIDAS_connector.beans.xml @@ -13,116 +13,101 @@ <import resource="common_gui.beans.xml"/> - <bean id="WebResourceConfiguration" - class="at.asitplus.eidas.specific.connector.config.StaticResourceConfiguration" /> - <bean id="processEngineSignalController" - class="at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalController" /> + class="at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalController" /> <bean id="saml2MetadataGeneration" class="at.asitplus.eidas.specific.connector.health.Saml2MetadataHealthIndicator"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> </bean> + <bean id="defaultErrorTicketService" + class="at.gv.egiz.eaaf.core.impl.idp.auth.services.DefaultErrorService"/> + <bean id="eidasNodeMetadata" class="at.asitplus.eidas.specific.connector.health.EidasNodeMetadataHealthIndicator" /> <bean id="AuthenticationManager" - class="at.asitplus.eidas.specific.connector.auth.AuthenticationManager" /> + class="at.asitplus.eidas.specific.connector.auth.AuthenticationManager" /> <bean id="AuthenticationDataBuilder" - class="at.asitplus.eidas.specific.connector.builder.AuthenticationDataBuilder" /> + class="at.asitplus.eidas.specific.connector.builder.AuthenticationDataBuilder" /> <bean id="PVPEndPointConfiguration" - class="at.asitplus.eidas.specific.connector.config.PvpEndPointConfiguration" /> + class="at.asitplus.eidas.specific.connector.config.PvpEndPointConfiguration" /> <bean id="PVPEndPointCredentialProvider" - class="at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider" /> + class="at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider" /> <bean id="PVPMetadataConfigurationFactory" - class="at.asitplus.eidas.specific.connector.provider.PvpMetadataConfigurationFactory" /> + class="at.asitplus.eidas.specific.connector.provider.PvpMetadataConfigurationFactory" /> <bean id="pvp2SProfileEndpoint" - class="at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> - <property name="metadataProvider"> - <ref bean="PVPMetadataProvider" /> - </property> + class="at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint"> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> + <property name="metadataProvider" ref="PVPMetadataProvider" /> </bean> <bean id="AuthnRequestValidator" - class="at.asitplus.eidas.specific.connector.verification.AuthnRequestValidator" /> + class="at.asitplus.eidas.specific.connector.verification.AuthnRequestValidator" /> - <bean id="SAMLVerificationEngine" - class="at.gv.egiz.eaaf.modules.pvp2.impl.verification.SamlVerificationEngine" /> + <!-- bean id="SAMLVerificationEngine" + class="at.gv.egiz.eaaf.modules.pvp2.impl.verification.SamlVerificationEngine" /--> <bean id="pvpMetadataService" - class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.MetadataAction"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> + class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.MetadataAction"> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> </bean> <bean id="PVPAuthenticationRequestAction" - class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.AuthenticationAction"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> - <property name="metadataProvider"> - <ref bean="PVPMetadataProvider" /> - </property> + class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.AuthenticationAction"> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> + <property name="metadataProvider" ref="PVPMetadataProvider" /> </bean> <bean id="eaafProtocolAuthenticationService" - class="at.gv.egiz.eaaf.core.impl.idp.auth.services.ProtocolAuthenticationService"> + class="at.gv.egiz.eaaf.core.impl.idp.auth.services.ProtocolAuthenticationService"> <property name="guiBuilder" ref="mvcGUIBuilderImpl" /> </bean> - <bean id="defaultErrorHandler" - class="at.gv.egiz.eaaf.core.impl.idp.auth.services.DefaultErrorService"/> - <bean id="securePendingRequestIdGeneration" - class="at.gv.egiz.eaaf.core.impl.utils.SecurePendingRequestIdGenerationStrategy" /> + class="at.gv.egiz.eaaf.core.impl.utils.SecurePendingRequestIdGenerationStrategy" /> <bean id="PVPMetadataProvider" - class="at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider" /> + class="at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider" /> <bean id="PVPSubjectNameGenerator" - class="at.asitplus.eidas.specific.connector.builder.PvpSubjectNameGenerator" /> + class="at.asitplus.eidas.specific.connector.builder.PvpSubjectNameGenerator" /> <bean id="LoALevelMapper" - class="at.asitplus.eidas.specific.connector.mapper.LoALevelMapper" /> + class="at.asitplus.eidas.specific.connector.mapper.LoALevelMapper" /> <bean id="GUIBuilderConfigurationFactory" - class="at.asitplus.eidas.specific.connector.gui.GuiBuilderConfigurationFactory" /> + class="at.asitplus.eidas.specific.connector.gui.GuiBuilderConfigurationFactory" /> <bean id="velocityGUIBuilderImpl" - class="at.asitplus.eidas.specific.connector.gui.DefaultVelocityGuiBuilderImpl" /> + class="at.asitplus.eidas.specific.connector.gui.DefaultVelocityGuiBuilderImpl" /> <bean id="mvcGUIBuilderImpl" - class="at.asitplus.eidas.specific.connector.gui.SpringMvcGuiFormBuilderImpl" /> + class="at.asitplus.eidas.specific.connector.gui.SpringMvcGuiFormBuilderImpl" /> <bean id="StatusMessageProvider" - class="at.asitplus.eidas.specific.connector.provider.StatusMessageProvider" /> + class="at.asitplus.eidas.specific.connector.provider.StatusMessageProvider" /> <bean id="eidasRevisionLogger" - class="at.asitplus.eidas.specific.connector.logger.RevisionLogger" /> + class="at.asitplus.eidas.specific.connector.logger.RevisionLogger" /> <bean id="eidasStatisticLogger" - class="at.asitplus.eidas.specific.connector.logger.StatisticLogger" /> + class="at.asitplus.eidas.specific.connector.logger.StatisticLogger" /> <!-- Tasks --> <bean id="GenerateCountrySelectionFrameTask" - class="at.asitplus.eidas.specific.connector.processes.tasks.GenerateCountrySelectionFrameTask" - scope="prototype" /> + class="at.asitplus.eidas.specific.connector.processes.tasks.GenerateCountrySelectionFrameTask" + scope="prototype" /> <bean id="EvaluateCountrySelectionTask" - class="at.asitplus.eidas.specific.connector.processes.tasks.EvaluateCountrySelectionTask" - scope="prototype" /> + class="at.asitplus.eidas.specific.connector.processes.tasks.EvaluateCountrySelectionTask" + scope="prototype" /> </beans>
\ No newline at end of file diff --git a/connector/src/main/resources/templates/countrySelection.html b/connector/src/main/resources/templates/countrySelection.html index 3937b464..b15234eb 100644 --- a/connector/src/main/resources/templates/countrySelection.html +++ b/connector/src/main/resources/templates/countrySelection.html @@ -3,12 +3,12 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="fragments/base" th:with="lang=${#locale.language}" th:lang="${lang}"> - + <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="$contextPath/static/css/css_country.css" th:href="@{/static/css/css_country.css}"/> - <script type="text/javascript" src="$contextPath/static/js/js_country.js" th:attr="src=@{/static/static/js/js_country.js}"></script> + <script type="text/javascript" src="$contextPath/static/js/js_country.js" th:attr="src=@{/static/static/js/js_country.js}"></script> <title th:text="#{gui.countryselection.title}">eIDAS-Login Länderauswahl</title> </head> @@ -17,236 +17,236 @@ <div class="languageselection" th:include="language_selection :: selectlanguage"> LanguageSelectionBlock </div> - + <h2 th:text="#{gui.countryselection.header.selection}"> Select your country </h2> <div id="country"> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Belgium-EU.png" alt="Belgium-eID" th:attr="src=@{img/countries/Belgium-EU.png},alt=#{gui.countryselection.country.be.logo.alt}"/></a> - <input type="submit" value="Belgium" th:attr="value=#{gui.countryselection.country.be}"> + <input type="submit" value="Belgium" th:attr="value=#{gui.countryselection.country.be}"> <input type="hidden" name="selectedCountry" value="BE"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Bulgaria-EU.png" alt="Bulgaria-eID" th:attr="src=@{img/countries/Bulgaria-EU.png},alt=#{gui.countryselection.country.bg.logo.alt}"/></a> <input type="submit" value="Bulgaria" th:attr="value=#{gui.countryselection.country.bg}" > <input type="hidden" name="selectedCountry" value="BG"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Croatia-EU.png" alt="Croatia-eID" th:attr="src=@{img/countries/Croatia-EU.png},alt=#{gui.countryselection.country.hr.logo.alt}"/></a> <input type="submit" value="Croatia" th:attr="value=#{gui.countryselection.country.hr}"> <input type="hidden" name="selectedCountry" value="HR"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Cyprus-EU.png" alt="Cyprus-eID" - th:attr="src=@{img/countries/Cyprus-EU.png},alt=#{gui.countryselection.country.cy.logo.alt}"/></a> + th:attr="src=@{img/countries/Cyprus-EU.png},alt=#{gui.countryselection.country.cy.logo.alt}"/></a> <input type="submit" value="Cyprus" th:attr="value=#{gui.countryselection.country.cy}"> <input type="hidden" name="selectedCountry" value="CY"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/CzechRepublic-EU.png" alt="CzechRepublic-eID" th:attr="src=@{img/countries/CzechRepublic-EU.png},alt=#{gui.countryselection.country.cz.logo.alt}"/></a> <input type="submit" value="CzechRepublic" th:attr="value=#{gui.countryselection.country.cz}"> <input type="hidden" name="selectedCountry" value="CZ"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Denmark-EU.png" alt="Denmark-eID" th:attr="src=@{img/countries/Denmark-EU.png},alt=#{gui.countryselection.country.dk.logo.alt}"/></a> <input type="submit" value="Denmark" th:attr="value=#{gui.countryselection.country.dk}"> <input type="hidden" name="selectedCountry" value="DK"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - <form class="block" method="post" action="$contextPath$submitEndpoint"> + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/germany-eu_.png" alt="Germany-eID" th:attr="src=@{img/countries/germany-eu_.png},alt=#{gui.countryselection.country.de.logo.alt}"/></a> <input type="submit" role="button" value="Deutschland / Germany" th:attr="value=#{gui.countryselection.country.de}" /> <input type="hidden" name="selectedCountry" value="DE"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Estonia-EU.png" alt="Estonia-eID" th:attr="src=@{img/countries/Estonia-EU.png},alt=#{gui.countryselection.country.ee.logo.alt}"/></a> <input type="submit" value="Estonia" th:attr="value=#{gui.countryselection.country.ee}"> <input type="hidden" name="selectedCountry" value="EE"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Finland-EU.png" alt="Finland-eID" th:attr="src=@{img/countries/Finland-EU.png},alt=#{gui.countryselection.country.fi.logo.alt}"/></a> <input type="submit" value="Finland" th:attr="value=#{gui.countryselection.country.fi}"> <input type="hidden" name="selectedCountry" value="FI"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/France-EU.png" alt="France-eID" th:attr="src=@{img/countries/France-EU.png},alt=#{gui.countryselection.country.fr.logo.alt}"/></a> <input type="submit" value="France" th:attr="value=#{gui.countryselection.country.fr}"> <input type="hidden" name="selectedCountry" value="FR"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Greece-EU.png" alt="Greece-eID" - th:attr="src=@{img/countries/Greece-EU.png},alt=#{gui.countryselection.country.gr.logo.alt}"/></a> + th:attr="src=@{img/countries/Greece-EU.png},alt=#{gui.countryselection.country.gr.logo.alt}"/></a> <input type="submit" value="Greece" th:attr="value=#{gui.countryselection.country.gr}"> <input type="hidden" name="selectedCountry" value="GR"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Hungary-EU.png" alt="Hungary-eID" - th:attr="src=@{img/countries/Hungary-EU.png},alt=#{gui.countryselection.country.hu.logo.alt}"/></a> + th:attr="src=@{img/countries/Hungary-EU.png},alt=#{gui.countryselection.country.hu.logo.alt}"/></a> <input type="submit" value="Hungary" th:attr="value=#{gui.countryselection.country.hu}"> <input type="hidden" name="selectedCountry" value="HU"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Ireland-EU.png" alt="Ireland-eID" th:attr="src=@{img/countries/Iceland.png},alt=#{gui.countryselection.country.is.logo.alt}"/></a> <input type="submit" value="Ireland" th:attr="value=#{gui.countryselection.country.is}"/> <input type="hidden" name="selectedCountry" value="IS"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Ireland-EU.png" alt="Ireland-eID" th:attr="src=@{img/countries/Ireland-EU.png},alt=#{gui.countryselection.country.ir.logo.alt}"/></a> <input type="submit" value="Ireland" th:attr="value=#{gui.countryselection.country.ir}"> <input type="hidden" name="selectedCountry" value="IE"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Italy-EU.png" alt="Italy-eID" th:attr="src=@{img/countries/Italy-EU.png},alt=#{gui.countryselection.country.it.logo.alt}"/></a> <input type="submit" value="Italy" th:attr="value=#{gui.countryselection.country.it}"> <input type="hidden" name="selectedCountry" value="IT"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Latvia-EU.png" alt="Latvia-eID" th:attr="src=@{img/countries/Latvia-EU.png},alt=#{gui.countryselection.country.lv.logo.alt}"/></a> <input type="submit" value="Latvia" th:attr="value=#{gui.countryselection.country.lv}"> <input type="hidden" name="selectedCountry" value="LV"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Luxembourg-EU.png" alt="Luxembourg-eID" th:attr="src=@{img/countries/Luxembourg-EU.png},alt=#{gui.countryselection.country.lu.logo.alt}"/></a> <input type="submit" value="Luxembourg" th:attr="value=#{gui.countryselection.country.lu}"> <input type="hidden" name="selectedCountry" value="LT"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Luxembourg-EU.png" alt="Luxembourg-eID" th:attr="src=@{img/countries/Luxembourg-EU.png},alt=#{gui.countryselection.country.lu.logo.alt}"/></a> <input type="submit" value="Luxembourg" th:attr="value=#{gui.countryselection.country.lu}"> <input type="hidden" name="selectedCountry" value="LU"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Malta-EU.png" alt="Malta-eID" th:attr="src=@{img/countries/Malta-EU.png},alt=#{gui.countryselection.country.mt.logo.alt}"/></a> <input type="submit" value="Malta" th:attr="value=#{gui.countryselection.country.mt}"> <input type="hidden" name="selectedCountry" value="MT"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/TheNetherlands-EU_.png" alt="Netherlands-eID" th:attr="src=@{img/countries/TheNetherlands-EU_.png},alt=#{gui.countryselection.country.nl.logo.alt}"/></a> - <input type="submit" value="Netherlands" th:attr="value=#{gui.countryselection.country.nl}"> + <input type="submit" value="Netherlands" th:attr="value=#{gui.countryselection.country.nl}"> <input type="hidden" name="selectedCountry" value="NL"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Poland-EU.png" alt="Poland-eID" th:attr="src=@{img/countries/Poland-EU.png},alt=#{gui.countryselection.country.pl.logo.alt}"/></a> <input type="submit" value="Poland" th:attr="value=#{gui.countryselection.country.pl}"> - <input type="hidden" name="selectedCountry" value="PL"> + <input type="hidden" name="selectedCountry" value="PL"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Portugal-EU.png" alt="Portugal-eID" - th:attr="src=@{img/countries/Portugal-EU.png},alt=#{gui.countryselection.country.pt.logo.alt}"/></a> + th:attr="src=@{img/countries/Portugal-EU.png},alt=#{gui.countryselection.country.pt.logo.alt}"/></a> <input type="submit" value="Portugal" th:attr="value=#{gui.countryselection.country.pt}"> <input type="hidden" name="selectedCountry" value="PT"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Romania-EU.png" alt="Romania-eID" - th:attr="src=@{img/countries/Romania-EU.png},alt=#{gui.countryselection.country.ro.logo.alt}"/></a> + th:attr="src=@{img/countries/Romania-EU.png},alt=#{gui.countryselection.country.ro.logo.alt}"/></a> <input type="submit" value="Romania" th:attr="value=#{gui.countryselection.country.ro}"> <input type="hidden" name="selectedCountry" value="RO"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Slovakia-EU.png" alt="Slovakia-eID" th:attr="src=@{img/countries/Slovakia-EU.png},alt=#{gui.countryselection.country.sk.logo.alt}"/></a> <input type="submit" value="Slovakia" th:attr="value=#{gui.countryselection.country.sk}"> <input type="hidden" name="selectedCountry" value="SK"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Slovenia-EU.png" alt="Slovenia-eID" th:attr="src=@{img/countries/Slovenia-EU.png},alt=#{gui.countryselection.country.si.logo.alt}"/></a> <input type="submit" value="Slovenia" th:attr="value=#{gui.countryselection.country.si}"> <input type="hidden" name="selectedCountry" value="SI"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Spain-EU.png" alt="Spain-eID" th:attr="src=@{img/countries/Spain-EU.png},alt=#{gui.countryselection.country.es.logo.alt}"/></a> <input type="submit" value="Spain" th:attr="value=#{gui.countryselection.country.es}"> <input type="hidden" name="selectedCountry" value="ES"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/Sweden-EU.png" alt="Sweden-eID" th:attr="src=@{img/countries/Sweden-EU.png},alt=#{gui.countryselection.country.se.logo.alt}"/></a> <input type="submit" value="Sweden" th:attr="value=#{gui.countryselection.country.se}"> <input type="hidden" name="selectedCountry" value="SE"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint"> + + <form class="block" method="post" action="$contextPath$submitEndpoint"> <a><img class="countryimage" src="$contextPath/img/countries/UnitedKingdom-EU.png" alt="UnitedKingdom-eID" th:attr="src=@{img/countries/UnitedKingdom-EU.png},alt=#{gui.countryselection.country.uk.logo.alt}"/></a> <input type="submit" value="United Kingdom" th:attr="value=#{gui.countryselection.country.uk}"> <input type="hidden" name="selectedCountry" value="UK"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - - <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> - <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancle}"> + + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancel}"> <input type="hidden" name="stopAuthProcess" value="true" > <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> </form> diff --git a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java index 64e8272e..4e66d324 100644 --- a/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java +++ b/connector/src/test/java/at/asitplus/eidas/specific/connector/test/FullStartUpAndProcessTest.java @@ -1,12 +1,13 @@ package at.asitplus.eidas.specific.connector.test; import static org.mockito.ArgumentMatchers.any; -import static org.powermock.api.mockito.PowerMockito.when; +import static org.mockito.Mockito.when; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; +import java.math.BigInteger; import java.net.URISyntaxException; import java.util.Map; import java.util.Timer; @@ -56,15 +57,28 @@ import at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalContro import at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint; import at.asitplus.eidas.specific.connector.provider.PvpEndPointCredentialProvider; import at.asitplus.eidas.specific.connector.provider.PvpMetadataProvider; -import at.asitplus.eidas.specific.connector.test.saml2.Pvp2SProfileEndPointTest; import at.asitplus.eidas.specific.modules.auth.eidas.v2.Constants; import at.asitplus.eidas.specific.modules.auth.eidas.v2.EidasSignalServlet; import at.asitplus.eidas.specific.modules.auth.eidas.v2.service.EidasAttributeRegistry; +import at.gv.bmi.namespace.zmr_su.base._20040201.ResponseType; +import at.gv.bmi.namespace.zmr_su.base._20040201.WorkflowInfoServer; +import at.gv.bmi.namespace.zmr_su.base._20040201_.ServicePort; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.EidasIdentitaetErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.NatuerlichePersonErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.NatuerlichePersonErgebnisType.PersonenName; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonErgebnisSatzType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonErgebnisType; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonSuchenResponse; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.Personendaten; +import at.gv.bmi.namespace.zmr_su.zmr._20040201.PersonensuchergebnisType; +import at.gv.e_government.reference.namespace.persondata.de._20040201.IdentificationType; import at.gv.egiz.components.spring.api.SpringBootApplicationContextInitializer; +import at.gv.egiz.eaaf.core.api.IStatusMessenger; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.api.data.PvpAttributeDefinitions; import at.gv.egiz.eaaf.core.exceptions.EaafException; import at.gv.egiz.eaaf.core.impl.idp.controller.ProtocolFinalizationController; +import at.gv.egiz.eaaf.core.impl.logging.LogMessageProviderFactory; import at.gv.egiz.eaaf.core.impl.utils.DomUtils; import at.gv.egiz.eaaf.core.impl.utils.Random; import at.gv.egiz.eaaf.modules.pvp2.exception.CredentialsNotAvailableException; @@ -93,7 +107,7 @@ import szrservices.SignContentResponseType; @SpringBootTest @ContextConfiguration(initializers = { org.springframework.boot.context.config.DelegatingApplicationContextInitializer.class, - SpringBootApplicationContextInitializer.class + SpringBootApplicationContextInitializer.class }) @TestPropertySource(locations = { "file:src/test/resources/config/junit_config_1_springboot.properties" }) @DirtiesContext(classMode = ClassMode.AFTER_CLASS) @@ -107,17 +121,20 @@ public class FullStartUpAndProcessTest { @Autowired private PvpMetadataProvider metadataProvider; @Autowired private ResourceLoader resourceLoader; @Autowired private EidasAttributeRegistry attrRegistry; - + @Autowired private Pvp2SProfileEndpoint sProfile; @Autowired private ProcessEngineSignalController signal; @Autowired private EidasSignalServlet eidasSignal; @Autowired private ProtocolFinalizationController finalize; + + @Autowired private IStatusMessenger messager; @Rule public final SoapServiceRule soap = SoapServiceRule.newInstance(); - + private SZR szrMock; - + private ServicePort zmrClient; + private String cc; private String givenName; private String familyName; @@ -125,8 +142,8 @@ public class FullStartUpAndProcessTest { private String personalId; private String vsz; private String eidasBind; - - + + /** * jUnit class initializer. * @throws InterruptedException In case of an error @@ -138,7 +155,7 @@ public class FullStartUpAndProcessTest { public static void classInitializer() throws InterruptedException, InitializationException, ComponentInitializationException { final String current = new java.io.File(".").toURI().toString(); System.clearProperty("eidas.ms.configuration"); - + //eIDAS Ref. Impl. properties System.setProperty("EIDAS_CONFIG_REPOSITORY", current.substring("file:".length()) + "../basicConfig/eIDAS/"); @@ -146,11 +163,11 @@ public class FullStartUpAndProcessTest { + "../basicConfig/eIDAS/"); System.setProperty("SPECIFIC_PROXY_SERVICE_CONFIG_REPOSITORY", current.substring("file:".length()) + "../basicConfig/eIDAS/"); - + EaafOpenSaml3xInitializer.eaafInitialize(); - + } - + /** * Test shut-down. * @@ -161,12 +178,11 @@ public class FullStartUpAndProcessTest { System.out.println("Closiong Ignite Node ... "); Ignition.stopAll(true); - //set Ignite-node holder to 'null' because static holders are shared between different tests final Field field = IgniteInstanceInitializerSpecificCommunication.class.getDeclaredField("instance"); field.setAccessible(true); field.set(null, null); - + } /** @@ -182,27 +198,29 @@ public class FullStartUpAndProcessTest { for (FilterRegistrationBean<?> filter : filters.values()) { if (filter.isEnabled()) { builder.addFilter(filter.getFilter(), "/*"); - + } } - szrMock = soap.mock(SZR.class, "http://localhost:1234/demoszr"); - - + LogMessageProviderFactory.setStatusMessager(messager); + szrMock = soap.mock(SZR.class, "http://localhost:1234/demoszr"); + zmrClient = soap.mock(ServicePort.class, "http://localhost:1234/demozmr"); + + cc = RandomStringUtils.randomAlphabetic(2).toUpperCase(); personalId = cc + "/AT/" + RandomStringUtils.randomNumeric(64); familyName = RandomStringUtils.randomAlphabetic(10); givenName = RandomStringUtils.randomAlphabetic(10); dateOfBirth = "2015-10-12"; - + vsz = RandomStringUtils.randomNumeric(10); eidasBind = RandomStringUtils.randomAlphanumeric(50); - + } - + @Test - public void userStopProcess() throws UnsupportedEncodingException, XMLParserException, UnmarshallingException, + public void userStopProcess() throws UnsupportedEncodingException, XMLParserException, UnmarshallingException, TransformerException, IOException, MarshallingException, ComponentInitializationException, EaafException { //start authentication process by sending a SAML2 Authn-Request MockHttpServletRequest saml2Req = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); @@ -210,74 +228,74 @@ public class FullStartUpAndProcessTest { MockHttpServletResponse selectCountryResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(saml2Req, selectCountryResp)); - - // send SAML2 AuthnRequest + + // send SAML2 AuthnRequest sProfile.pvpIdpPostRequest(saml2Req, selectCountryResp); - + //check country-selection response Assert.assertEquals("no country-selection page", 200, selectCountryResp.getStatus()); Assert.assertEquals("cc-selection page", "text/html;charset=UTF-8", selectCountryResp.getContentType()); String selectionPage = selectCountryResp.getContentAsString(); Assert.assertNotNull("selectionPage is null", selectionPage); Assert.assertFalse("selectionPage is empty", selectionPage.isEmpty()); - - String pendingReqId = extractRequestToken(selectionPage, + + String pendingReqId = extractRequestToken(selectionPage, "<input type=\"hidden\" name=\"pendingid\" value=\""); Assert.assertFalse("PendingReqId", pendingReqId.isEmpty()); - - + + // set-up user-stop request MockHttpServletRequest userStopReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); userStopReq.setParameter("pendingid", pendingReqId); userStopReq.setParameter(EaafConstants.PARAM_HTTP_STOP_PROCESS, "true"); - + MockHttpServletResponse finalizeResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(userStopReq, finalizeResp)); - + // send user-stop request signal.performGenericAuthenticationProcess(userStopReq, finalizeResp); - + //validate state Assert.assertEquals("forward to finalization", 302, finalizeResp.getStatus()); Assert.assertNotNull("missing redirect header", finalizeResp.getHeader("Location")); Assert.assertTrue("wrong redirect header", finalizeResp.getHeader("Location").startsWith(FINAL_REDIRECT)); String finalPendingReqId = finalizeResp.getHeader("Location").substring(FINAL_REDIRECT.length()); Assert.assertFalse("final pendingRequestId", finalPendingReqId.isEmpty()); - + //set-up finalization request MockHttpServletRequest finalizationReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); finalizationReq.setParameter("pendingid", finalPendingReqId); - + MockHttpServletResponse saml2Resp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(finalizationReq, saml2Resp)); - + // exexcute finalization step finalize.finalizeAuthProtocol(finalizationReq, saml2Resp); - + //validate state Assert.assertEquals("forward to finalization", 200, saml2Resp.getStatus()); Assert.assertEquals("forward to eIDAS Node page", "text/html;charset=UTF-8", saml2Resp.getContentType()); String saml2RespPage = saml2Resp.getContentAsString(); Assert.assertNotNull("selectionPage is null", saml2RespPage); Assert.assertFalse("selectionPage is empty", saml2RespPage.isEmpty()); - + //validate SAML2 response - String saml2RespB64 = extractRequestToken(saml2RespPage, + String saml2RespB64 = extractRequestToken(saml2RespPage, "<input type=\"hidden\" name=\"SAMLResponse\" value=\""); Assert.assertNotNull("SAML2 response", saml2RespB64); - + StatusResponseType saml2 = (StatusResponseType) XMLObjectSupport.unmarshallFromInputStream( - XMLObjectProviderRegistrySupport.getParserPool(), + XMLObjectProviderRegistrySupport.getParserPool(), new ByteArrayInputStream(Base64Utils.decodeFromString(saml2RespB64))); - Assert.assertEquals("SAML2 status", "urn:oasis:names:tc:SAML:2.0:status:Responder", + Assert.assertEquals("SAML2 status", "urn:oasis:names:tc:SAML:2.0:status:Responder", saml2.getStatus().getStatusCode().getValue()); - Assert.assertEquals("ms-connector status", "1005", + Assert.assertEquals("ms-connector status", "1005", saml2.getStatus().getStatusCode().getStatusCode().getValue()); - + } - + @Test public void fullSuccessProcess() throws EaafException, Exception { //start authentication process by sending a SAML2 Authn-Request @@ -286,112 +304,114 @@ public class FullStartUpAndProcessTest { MockHttpServletResponse selectCountryResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(saml2Req, selectCountryResp)); - - // send SAML2 AuthnRequest + + // send SAML2 AuthnRequest sProfile.pvpIdpPostRequest(saml2Req, selectCountryResp); - + //check country-selection response Assert.assertEquals("no country-selection page", 200, selectCountryResp.getStatus()); Assert.assertEquals("cc-selection page", "text/html;charset=UTF-8", selectCountryResp.getContentType()); String selectionPage = selectCountryResp.getContentAsString(); Assert.assertNotNull("selectionPage is null", selectionPage); Assert.assertFalse("selectionPage is empty", selectionPage.isEmpty()); - - String pendingReqId = extractRequestToken(selectionPage, + + String pendingReqId = extractRequestToken(selectionPage, "<input type=\"hidden\" name=\"pendingid\" value=\""); Assert.assertFalse("PendingReqId", pendingReqId.isEmpty()); - - + + // set-up country-selection request MockHttpServletRequest selectCountryReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); selectCountryReq.setParameter("pendingid", pendingReqId); selectCountryReq.setParameter("selectedCountry", cc); - + MockHttpServletResponse forwardEidasNodeResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(selectCountryReq, forwardEidasNodeResp)); - + // send country-selection request signal.performGenericAuthenticationProcess(selectCountryReq, forwardEidasNodeResp); - + //check forward to eIDAS node response Assert.assertEquals("forward to eIDAS Node", 200, forwardEidasNodeResp.getStatus()); Assert.assertEquals("forward to eIDAS Node page", "text/html;charset=UTF-8", forwardEidasNodeResp.getContentType()); String forwardPage = forwardEidasNodeResp.getContentAsString(); Assert.assertNotNull("forward to eIDAS Node is null", forwardPage); Assert.assertFalse("forward to eIDAS Node is empty", forwardPage.isEmpty()); - - String eidasNodeReqToken = extractRequestToken(forwardPage, + + String eidasNodeReqToken = extractRequestToken(forwardPage, "<input type=\"hidden\" name=\"token\" value=\""); Assert.assertFalse("eidas req. token", eidasNodeReqToken.isEmpty()); - + //check eIDAS node request and build respose String eidasRespToken = validateEidasNodeRequestAndBuildResponse(eidasNodeReqToken); Assert.assertFalse("eidas resp. token", eidasRespToken.isEmpty()); - - + + // set-up eIDAS-node response MockHttpServletRequest eidasNodeRespReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); eidasNodeRespReq.setParameter("token", eidasRespToken); - + MockHttpServletResponse finalizeResp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(eidasNodeRespReq, finalizeResp)); - - injectSzrResponse(); + + injectZmrResponse(); + injectSzrResponse(); //excute eIDAS node response eidasSignal.restoreEidasAuthProcess(eidasNodeRespReq, finalizeResp); - + //validate state Assert.assertEquals("forward to finalization", 302, finalizeResp.getStatus()); Assert.assertNotNull("missing redirect header", finalizeResp.getHeader("Location")); Assert.assertTrue("wrong redirect header", finalizeResp.getHeader("Location").startsWith(FINAL_REDIRECT)); String finalPendingReqId = finalizeResp.getHeader("Location").substring(FINAL_REDIRECT.length()); Assert.assertFalse("final pendingRequestId", finalPendingReqId.isEmpty()); - - + + //set-up finalization request MockHttpServletRequest finalizationReq = new MockHttpServletRequest("POST", "https://localhost/ms_connector"); finalizationReq.setParameter("pendingid", finalPendingReqId); - + MockHttpServletResponse saml2Resp = new MockHttpServletResponse(); RequestContextHolder.resetRequestAttributes(); RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(finalizationReq, saml2Resp)); - + // exexcute finalization step finalize.finalizeAuthProtocol(finalizationReq, saml2Resp); - + //validate state Assert.assertEquals("forward to finalization", 200, saml2Resp.getStatus()); Assert.assertEquals("forward to eIDAS Node page", "text/html;charset=UTF-8", saml2Resp.getContentType()); String saml2RespPage = saml2Resp.getContentAsString(); Assert.assertNotNull("selectionPage is null", saml2RespPage); Assert.assertFalse("selectionPage is empty", saml2RespPage.isEmpty()); - + //validate SAML2 response - String saml2RespB64 = extractRequestToken(saml2RespPage, + String saml2RespB64 = extractRequestToken(saml2RespPage, "<input type=\"hidden\" name=\"SAMLResponse\" value=\""); Assert.assertNotNull("SAML2 response", saml2RespB64); - + StatusResponseType saml2 = (StatusResponseType) XMLObjectSupport.unmarshallFromInputStream( - XMLObjectProviderRegistrySupport.getParserPool(), + XMLObjectProviderRegistrySupport.getParserPool(), new ByteArrayInputStream(Base64Utils.decodeFromString(saml2RespB64))); Assert.assertEquals("SAML2 status", Constants.SUCCESS_URI, saml2.getStatus().getStatusCode().getValue()); - + final AssertionAttributeExtractor extractor = new AssertionAttributeExtractor(saml2); + Assert.assertEquals("wrong resp attr. size", 7, extractor.getAllIncludeAttributeNames().size()); - Assert.assertEquals("Wrong attr: LoA ", "http://eidas.europa.eu/LoA/high", + Assert.assertEquals("Wrong attr: LoA ", "http://eidas.europa.eu/LoA/high", extractor.getSingleAttributeValue("urn:oid:1.2.40.0.10.2.1.1.261.108")); - Assert.assertEquals("Wrong attr: PVP_VERSION ", "2.2", + Assert.assertEquals("Wrong attr: PVP_VERSION ", "2.2", extractor.getSingleAttributeValue("urn:oid:1.2.40.0.10.2.1.1.261.10")); - Assert.assertEquals("Wrong attr: EID_ISSUER_NATION ", cc, + Assert.assertEquals("Wrong attr: EID_ISSUER_NATION ", cc, extractor.getSingleAttributeValue("urn:oid:1.2.40.0.10.2.1.1.261.32")); - Assert.assertEquals("Wrong attr: eidasBind", eidasBind, + Assert.assertEquals("Wrong attr: eidasBind", eidasBind, extractor.getSingleAttributeValue("urn:eidgvat:attributes.eidbind")); - Assert.assertNotNull("Wrong attr: authBlock", + Assert.assertNotNull("Wrong attr: authBlock", extractor.getSingleAttributeValue("urn:eidgvat:attributes.authblock.signed")); - Assert.assertNotNull("Wrong attr: piiTras.Id ", + Assert.assertNotNull("Wrong attr: piiTras.Id ", extractor.getSingleAttributeValue("urn:eidgvat:attributes.piiTransactionId")); Assert.assertEquals("Wrong attr:EID_STATUS_LEVEL ", "http://eid.gv.at/eID/status/identity", extractor.getSingleAttributeValue(PvpAttributeDefinitions.EID_IDENTITY_STATUS_LEVEL_NAME)); @@ -399,36 +419,82 @@ public class FullStartUpAndProcessTest { } private void injectSzrResponse() throws Exception { - - when(szrMock, "getStammzahlEncrypted", any(), any()).thenReturn(vsz); + + when(szrMock.getStammzahlEncrypted(any(), any())).thenReturn(vsz); val signContentResp = new SignContentResponseType(); final SignContentEntry signContentEntry = new SignContentEntry(); signContentEntry.setValue(eidasBind); signContentResp.getOut().add(signContentEntry); - when(szrMock, "signContent", any(), any(), any()).thenReturn(signContentResp); + when(szrMock.signContent(any(), any(), any())).thenReturn(signContentResp); + + } + + private void injectZmrResponse() throws Exception { + ResponseType resp = new ResponseType(); + + WorkflowInfoServer workflow = new WorkflowInfoServer(); + workflow.setProzessInstanzID(new BigInteger(RandomStringUtils.randomNumeric(10))); + resp.setWorkflowInfoServer(workflow); + + PersonSuchenResponse persRespObj = new PersonSuchenResponse(); + PersonensuchergebnisType searchResult = new PersonensuchergebnisType(); + PersonErgebnisSatzType personInfoObj = new PersonErgebnisSatzType(); + resp.setPersonSuchenResponse(persRespObj); + persRespObj.setPersonensuchergebnis(searchResult); + + searchResult.setGefundeneSaetzeERnP(0); + searchResult.setGefundeneSaetze(1); + searchResult.getPersonErgebnisSatz().add(personInfoObj); + + PersonErgebnisType personInfo = new PersonErgebnisType(); + Personendaten personDataObj = new Personendaten(); + personInfoObj.setPersonendaten(personDataObj); + personDataObj.getPersonErgebnis().add(personInfo); + + EidasIdentitaetErgebnisType eidasPersonalIdentifier = new EidasIdentitaetErgebnisType(); + personInfo.getEidasIdentitaet().add(eidasPersonalIdentifier); + eidasPersonalIdentifier.setEidasWert(personalId); + eidasPersonalIdentifier.setEidasArt(Constants.eIDAS_ATTRURN_PERSONALIDENTIFIER); + eidasPersonalIdentifier.setStaatscode2(cc); + + NatuerlichePersonErgebnisType natInfo = new NatuerlichePersonErgebnisType(); + IdentificationType bpk = new IdentificationType(); + PersonenName natName = new PersonenName(); + natInfo.getIdentification().add(bpk); + natInfo.setPersonenName(natName); + personInfo.setNatuerlichePerson(natInfo); + + bpk.setType(EaafConstants.URN_PREFIX_CDID + "ZP"); + bpk.setValue(RandomStringUtils.randomAlphabetic(10)); + natInfo.setGeburtsdatum(dateOfBirth); + natName.setFamilienname(familyName); + natName.setVorname(givenName); + + when(zmrClient.service(any(), any())).thenReturn(resp); } + - private String validateEidasNodeRequestAndBuildResponse(String eidasNodeReqToken) + private String validateEidasNodeRequestAndBuildResponse(String eidasNodeReqToken) throws SpecificCommunicationException, URISyntaxException { final SpecificCommunicationService springManagedSpecificConnectorCommunicationService = (SpecificCommunicationService) wac.getBean( SpecificCommunicationDefinitionBeanNames.SPECIFIC_CONNECTOR_COMMUNICATION_SERVICE.toString()); - - //read request and validate basic properties - ILightRequest req = springManagedSpecificConnectorCommunicationService.getAndRemoveRequest(eidasNodeReqToken, + + //read request and validate basic properties + ILightRequest req = springManagedSpecificConnectorCommunicationService.getAndRemoveRequest(eidasNodeReqToken, attrRegistry.getCoreAttributeRegistry().getAttributes()); - + Assert.assertNotNull("eIDAS Node req", req); Assert.assertEquals("Wrong CC", cc, req.getCitizenCountryCode()); Assert.assertEquals("Wrong CC", EaafConstants.EIDAS_LOA_HIGH, req.getLevelOfAssurance()); - - + + //set response from eIDAS node BinaryLightToken respoToken = springManagedSpecificConnectorCommunicationService.putResponse( buildDummyAuthResponse(Constants.SUCCESS_URI, req.getId())); return Base64Utils.encodeToString(respoToken.getTokenBytes()); - + } private AuthenticationResponse buildDummyAuthResponse(String statusCode, String reqId) throws URISyntaxException { @@ -440,7 +506,7 @@ public class FullStartUpAndProcessTest { Constants.eIDAS_ATTR_CURRENTGIVENNAME).first(); final AttributeDefinition<?> attributeDef4 = attrRegistry.getCoreAttributeRegistry().getByFriendlyName( Constants.eIDAS_ATTR_DATEOFBIRTH).first(); - + final ImmutableAttributeMap attributeMap = ImmutableAttributeMap.builder() .put(attributeDef, personalId) .put(attributeDef2, familyName) @@ -457,40 +523,40 @@ public class FullStartUpAndProcessTest { .levelOfAssurance(EaafConstants.EIDAS_LOA_HIGH) .attributes(attributeMap) .build(); - + } - + private String extractRequestToken(String selectionPage, String selector) { int start = selectionPage.indexOf(selector); Assert.assertTrue("find no pendingReqId location start", start > 0); int end = selectionPage.indexOf("\"", start + selector.length()); Assert.assertTrue("find no pendingReqId location end", end > 0); return selectionPage.substring(start + selector.length(), end); - + } - private void injectSaml2AuthnReq(MockHttpServletRequest saml2Req) throws XMLParserException, UnmarshallingException, - SamlSigningException, CredentialsNotAvailableException, UnsupportedEncodingException, TransformerException, + private void injectSaml2AuthnReq(MockHttpServletRequest saml2Req) throws XMLParserException, UnmarshallingException, + SamlSigningException, CredentialsNotAvailableException, UnsupportedEncodingException, TransformerException, IOException, MarshallingException, ComponentInitializationException { final RequestAbstractType authnReq = (RequestAbstractType) XMLObjectSupport.unmarshallFromInputStream( XMLObjectProviderRegistrySupport.getParserPool(), - Pvp2SProfileEndPointTest.class.getResourceAsStream("/data/pvp2_authn_1.xml")); - authnReq.setIssueInstant(DateTime.now()); - RequestAbstractType signedAuthnReq = - Saml2Utils.signSamlObject(authnReq, credentialProvider.getMessageSigningCredential(), true); + FullStartUpAndProcessTest.class.getResourceAsStream("/data/pvp2_authn_1.xml")); + authnReq.setIssueInstant(DateTime.now()); + RequestAbstractType signedAuthnReq = + Saml2Utils.signSamlObject(authnReq, credentialProvider.getMessageSigningCredential(), true); String b64 = Base64Utils.encodeToString(DomUtils.serializeNode( - XMLObjectSupport.getMarshaller(signedAuthnReq).marshall(signedAuthnReq)).getBytes("UTF-8")); + XMLObjectSupport.getMarshaller(signedAuthnReq).marshall(signedAuthnReq)).getBytes("UTF-8")); saml2Req.setParameter("SAMLRequest", b64); - + final org.springframework.core.io.Resource resource = resourceLoader.getResource( "classpath:/data/metadata_valid_without_encryption.xml"); Timer timer = new Timer("PVP metadata-resolver refresh"); - ResourceBackedMetadataResolver fileSystemResolver = + ResourceBackedMetadataResolver fileSystemResolver = new ResourceBackedMetadataResolver(timer, new OpenSaml3ResourceAdapter(resource)); fileSystemResolver.setId("test"); fileSystemResolver.setParserPool(XMLObjectProviderRegistrySupport.getParserPool()); - fileSystemResolver.initialize(); + fileSystemResolver.initialize(); metadataProvider.addMetadataResolverIntoChain(fileSystemResolver); - + } } diff --git a/connector/src/test/resources/config/junit_config_1_springboot.properties b/connector/src/test/resources/config/junit_config_1_springboot.properties index e63cda7b..3544c3a9 100644 --- a/connector/src/test/resources/config/junit_config_1_springboot.properties +++ b/connector/src/test/resources/config/junit_config_1_springboot.properties @@ -43,6 +43,19 @@ eidas.ms.auth.eIDAS.szrclient.debug.logfullmessages=true eidas.ms.auth.eIDAS.szrclient.debug.useDummySolution=false +#### matching###### +# ZMR communication +eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 +eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT + + ## PVP2 S-Profile end-point configuration eidas.ms.pvp2.keystore.type=jks @@ -81,3 +94,39 @@ eidas.ms.sp.1.pvp2.metadata.url=http://junit.test/metadata eidas.ms.sp.1.policy.allowed.requested.targets=test eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true +## PVP2 S-Profile client configuration +#eidas.ms.modules.idaustriaclient.keystore.type=jks +#eidas.ms.modules.idaustriaclient.keystore.path=keys/junit.jks1 +#eidas.ms.modules.idaustriaclient.keystore.password=password +#eidas.ms.modules.idaustriaclient.key.metadata.alias=meta +#eidas.ms.modules.idaustriaclient.key.metadata.password=password +#eidas.ms.modules.idaustriaclient.key.signing.alias=sig +#eidas.ms.modules.idaustriaclient.key.signing.password=password +#eidas.ms.modules.idaustriaclient.metadata.validity=24 + +eidas.ms.modules.idaustriaclient.keystore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.keystore.password=password +eidas.ms.modules.idaustriaclient.keystore.type=jks + +eidas.ms.modules.idaustriaclient.metadata.sign.alias=meta +eidas.ms.modules.idaustriaclient.metadata.sign.password=password +eidas.ms.modules.idaustriaclient.request.sign.alias=sig +eidas.ms.modules.idaustriaclient.request.sign.password=password +eidas.ms.modules.idaustriaclient.response.encryption.alias=enc +eidas.ms.modules.idaustriaclient.response.encryption.password=password + +eidas.ms.modules.idaustriaclient.truststore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.truststore.password=password +eidas.ms.modules.idaustriaclient.truststore.type=jks + +eidas.ms.modules.idaustriaclient.node.entityId= +eidas.ms.modules.idaustriaclient.sp.entityId= +eidas.ms.modules.idaustriaclient.node.metadataUrl= + +eidas.ms.modules.idaustriaclient.metadata.organisation.name=JUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.url=http://junit.test +eidas.ms.modules.idaustriaclient.metadata.contact.givenname=Max +eidas.ms.modules.idaustriaclient.metadata.contact.surname=Mustermann +eidas.ms.modules.idaustriaclient.metadata.contact.email=max@junit.test + diff --git a/connector/src/test/resources/config/junit_config_2_springboot.properties b/connector/src/test/resources/config/junit_config_2_springboot.properties index ecb22dec..a67e387f 100644 --- a/connector/src/test/resources/config/junit_config_2_springboot.properties +++ b/connector/src/test/resources/config/junit_config_2_springboot.properties @@ -43,6 +43,18 @@ eidas.ms.auth.eIDAS.szrclient.debug.logfullmessages=true eidas.ms.auth.eIDAS.szrclient.debug.useDummySolution=false +#### matching###### +# ZMR communication +eidas.ms.auth.eIDAS.zmrclient.endpoint=http://localhost:1234/demozmr +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.type=jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.path=keys/junit.jks +eidas.ms.auth.eIDAS.zmrclient.ssl.keyStore.password=password +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.path= +eidas.ms.auth.eIDAS.zmrclient.ssl.trustStore.password= + +eidas.ms.auth.eIDAS.zmrclient.req.organisation.behoerdennr=jUnit123456 +eidas.ms.auth.eIDAS.zmrclient.req.update.reason.code=EIDAS-KITT + ## PVP2 S-Profile end-point configuration eidas.ms.pvp2.keystore.type=jks @@ -81,3 +93,39 @@ eidas.ms.sp.1.pvp2.metadata.url=http://junit.test/metadata eidas.ms.sp.1.policy.allowed.requested.targets=test eidas.ms.sp.1.policy.hasBaseIdTransferRestriction=true + +## PVP2 S-Profile client configuration +#eidas.ms.modules.idaustriaclient.keystore.type=jks +#eidas.ms.modules.idaustriaclient.keystore.path=keys/junit.jks1 +#eidas.ms.modules.idaustriaclient.keystore.password=password +#eidas.ms.modules.idaustriaclient.key.metadata.alias=meta +#eidas.ms.modules.idaustriaclient.key.metadata.password=password +#eidas.ms.modules.idaustriaclient.key.signing.alias=sig +#eidas.ms.modules.idaustriaclient.key.signing.password=password +#eidas.ms.modules.idaustriaclient.metadata.validity=24 + +eidas.ms.modules.idaustriaclient.keystore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.keystore.password=password +eidas.ms.modules.idaustriaclient.keystore.type=jks + +eidas.ms.modules.idaustriaclient.metadata.sign.alias=meta +eidas.ms.modules.idaustriaclient.metadata.sign.password=password +eidas.ms.modules.idaustriaclient.request.sign.alias=sig +eidas.ms.modules.idaustriaclient.request.sign.password=password +eidas.ms.modules.idaustriaclient.response.encryption.alias=enc +eidas.ms.modules.idaustriaclient.response.encryption.password=password + +eidas.ms.modules.idaustriaclient.truststore.path=keys/junit_test.jks +eidas.ms.modules.idaustriaclient.truststore.password=password +eidas.ms.modules.idaustriaclient.truststore.type=jks + +eidas.ms.modules.idaustriaclient.node.entityId= +eidas.ms.modules.idaustriaclient.node.metadataUrl= + +eidas.ms.modules.idaustriaclient.metadata.organisation.name=JUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.friendyname=For testing with jUnit +eidas.ms.modules.idaustriaclient.metadata.organisation.url=http://junit.test +eidas.ms.modules.idaustriaclient.metadata.contact.givenname=Max +eidas.ms.modules.idaustriaclient.metadata.contact.surname=Mustermann +eidas.ms.modules.idaustriaclient.metadata.contact.email=max@junit.test + diff --git a/connector/src/test/resources/config/keys/junit_test.jks b/connector/src/test/resources/config/keys/junit_test.jks Binary files differnew file mode 100644 index 00000000..ee6254a9 --- /dev/null +++ b/connector/src/test/resources/config/keys/junit_test.jks diff --git a/connector/src/test/resources/config/properties/messages.properties b/connector/src/test/resources/config/properties/messages.properties index ea604cda..9f7f8f7c 100644 --- a/connector/src/test/resources/config/properties/messages.properties +++ b/connector/src/test/resources/config/properties/messages.properties @@ -18,7 +18,7 @@ gui.countryselection.header1=Federal Ministry of Internal Affairs gui.countryselection.header2=Austrian Central eIDAS Node gui.countryselection.header3=Operated by Federal Ministry of Internal Affairs gui.countryselection.header.selection=Select your country -gui.countryselection.cancle=Cancel +gui.countryselection.cancel=Cancel gui.countryselection.notsupportedinfo=If you cannot find your country in this list then your electronic identity (eID) is not yet supported. gui.countryselection.infos.general.header=Information on Logins with European eIDs diff --git a/connector/src/test/resources/config/properties/messages_de.properties b/connector/src/test/resources/config/properties/messages_de.properties index 989b8d9c..41ef2551 100644 --- a/connector/src/test/resources/config/properties/messages_de.properties +++ b/connector/src/test/resources/config/properties/messages_de.properties @@ -18,7 +18,7 @@ gui.countryselection.header1=Bundesministerium für Inneres gui.countryselection.header2=Zentraler eIDAS Knoten der Republik Österreich gui.countryselection.header3=Betrieben durch das Bundesministerium für Inneres gui.countryselection.header.selection=Wählen Sie Ihr Land -gui.countryselection.cancle=Abbrechen +gui.countryselection.cancel=Abbrechen gui.countryselection.notsupportedinfo=Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken, dann wird Ihre elektronische Identität (eID) leider noch nicht unterstützt. gui.countryselection.infos.general.header=Information zur Anmeldung über Europäische eIDs diff --git a/connector/src/test/resources/config/templates/countrySelection.html b/connector/src/test/resources/config/templates/countrySelection.html index 7fbc9464..2483030b 100644 --- a/connector/src/test/resources/config/templates/countrySelection.html +++ b/connector/src/test/resources/config/templates/countrySelection.html @@ -2,7 +2,7 @@ <html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="fragments/base" - th:with="lang=${#locale.language}" th:lang="${lang}"> + th:with="lang=${#locale.language}" th:lang="${lang}"> <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -17,17 +17,17 @@ body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } -div.header { +div.header { background-color: #e9ecef; padding-top: 28px; padding-left: 137px; padding-right: 137px; padding-bottom: 12px; } -div.titlebar { +div.titlebar { padding: 0px; } -div.titlebar div { +div.titlebar div { } .hidden { display: none; @@ -40,7 +40,7 @@ ul.nav_oben { } li { display: inline-block; -} +} div.header a { text-decoration: none; color: black; @@ -55,7 +55,7 @@ a { padding-bottom: 20px; } @media only screen and (min-width: 1000px) { - div.header { + div.header { padding-left: 137px; padding-right: 137px; } @@ -69,7 +69,7 @@ a { } } @media only screen and (max-width: 999px) { - div.header { + div.header { padding-left: 1em; padding-right: 1em; } @@ -114,10 +114,10 @@ footer { font-size: 80%; } #countries { - padding-bottom: 40px; + padding-bottom: 40px; } #country { - padding-bottom: 20px; + padding-bottom: 20px; } input[type=submit] { width: inherit; @@ -131,7 +131,7 @@ form { /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/ if (!Element.prototype.matches) - Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; if (!Element.prototype.closest) @@ -141,7 +141,7 @@ if (!Element.prototype.closest) do { if (el.matches(s)) return el; el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); + } while (el !== null && el.nodeType === 1); return null; }; @@ -149,7 +149,7 @@ if (!Element.prototype.closest) function clickCountryFlag(element) { if (!element) return false; - var form = element.closest("form"); + var form = element.closest("form"); if (!form) return false; @@ -188,43 +188,43 @@ function clickCountryFlag(element) { <h1 th:text="#{gui.countryselection.header.selection}"> Wählen Sie Ihr Land / Select your country </h1> <div id="country"> - <!-- Active countries --> + <!-- Active countries --> <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/germany-eu_.png" alt="Germany-eID" th:attr="src=@{/img/countries/germany-eu_.png},alt=#{gui.countryselection.country.de.logo.alt}"/></a> <input type="submit" role="button" value="Deutschland / Germany" th:attr="value=#{gui.countryselection.country.de}" /> - <input type="hidden" name="selectedCountry" value="XX"> - <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> + <input type="hidden" name="selectedCountry" value="XX"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> </form> - + </div> <!-- Abbrechen Button --> - <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> - <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancle}"> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancel}"> <input type="hidden" name="stopAuthProcess" value="true" > <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> </form> - <p th:text="#{gui.countryselection.notsupportedinfo}" >Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken ... </p> - + <p th:text="#{gui.countryselection.notsupportedinfo}" >Wenn Sie Ihr Land in dieser Aufzählung nicht entdecken ... </p> + <h2 th:text="#{gui.countryselection.infos.general.header}" > Information zur Anmeldung über Europäische eIDs </h2> <p> - <span th:text="#{gui.countryselection.infos.general.part.1}"> first part </span> - <a href="https://www.bmi.gv.at/" target="_blank" th:text="#{gui.countryselection.header1}" > Bundesministerium für Inneres </a> + <span th:text="#{gui.countryselection.infos.general.part.1}"> first part </span> + <a href="https://www.bmi.gv.at/" target="_blank" th:text="#{gui.countryselection.header1}" > Bundesministerium für Inneres </a> <span th:text="#{gui.countryselection.infos.general.part.2}"> second part </span> </p> - + <p> <span th:text="#{gui.countryselection.infos.general.part.3}"> third part </span> - <a href="https://eur-lex.europa.eu/legal-content/DE/TXT/HTML/?uri=CELEX:32014R0910&from=DE" target="_blank" th:text="#{gui.countryselection.infos.general.link.1}"> eIDAS-Verordnung der Europäischen Union </a> + <a href="https://eur-lex.europa.eu/legal-content/DE/TXT/HTML/?uri=CELEX:32014R0910&from=DE" target="_blank" th:text="#{gui.countryselection.infos.general.link.1}"> eIDAS-Verordnung der Europäischen Union </a> <span th:text="#{gui.countryselection.infos.general.part.4}"> fourth part </span> </p> <p <span th:text="#{gui.countryselection.infos.general.part.5}"> fived part </span> <a href="https://www.dsb.gv.at/-/das-erganzungsregister-fur-naturliche-personen-ernp-" target="_blank" th:text="#{gui.countryselection.infos.general.link.2}" ></a> - <span th:text="#{gui.countryselection.infos.general.part.6}"> sixed part </span> + <span th:text="#{gui.countryselection.infos.general.part.6}"> sixed part </span> </p> </div> diff --git a/connector/src/test/resources/config/templates/countrySelection_example.html b/connector/src/test/resources/config/templates/countrySelection_example.html index 3b7c2d50..2128f14d 100644 --- a/connector/src/test/resources/config/templates/countrySelection_example.html +++ b/connector/src/test/resources/config/templates/countrySelection_example.html @@ -3,12 +3,12 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="fragments/base" th:with="lang=${#locale.language}" th:lang="${lang}"> - + <head> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="$contextPath/static/css/css_country.css" th:href="@{/static/css/css_country.css}"/> - <script type="text/javascript" src="$contextPath/static/js/js_country.js" th:attr="src=@{/static/js/js_country.js}"></script> + <script type="text/javascript" src="$contextPath/static/js/js_country.js" th:attr="src=@{/static/js/js_country.js}"></script> <title th:text="#{gui.countryselection.title}">eIDAS-Login Länderauswahl</title> </head> @@ -17,194 +17,194 @@ <div class="languageselection" th:include="language_selection :: selectlanguage"> LanguageSelectionBlock </div> - + <h2 th:text="#{gui.countryselection.header.selection}"> Select your country </h2> <div id="country"> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/germany-eu_.png" alt="Germany-eID" th:attr="src=@{/img/countries/germany-eu_.png},alt=#{gui.countryselection.country.de.logo.alt}"/></a> <input type="submit" role="button" value="Deutschland / Germany" th:attr="value=#{gui.countryselection.country.de}" /> - <input type="hidden" name="selectedCountry" value="DE"> + <input type="hidden" name="selectedCountry" value="DE"> <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}" /> - <select id="testEnvironment" name="selectedEnvironment"> - <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> + <select id="testEnvironment" name="selectedEnvironment"> + <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> <option value="qs" th:text="#{gui.countryselection.mode.qs}">QS</option> <option value="test" th:text="#{gui.countryselection.mode.test}">Testing</option> <option value="dev" th:text="#{gui.countryselection.mode.dev}">Development</option> </select> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Belgium-EU_gray.png" alt="Belgium-eID" th:attr="src=@{img/countries/Belgium-EU_gray.png},alt=#{gui.countryselection.country.be.logo.alt}"/></a> - <input type="submit" value="Belgium" th:attr="value=#{gui.countryselection.country.be}"> + <input type="submit" value="Belgium" th:attr="value=#{gui.countryselection.country.be}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Bulgaria-EU_gray.png" alt="Bulgaria-eID" th:attr="src=@{/img/countries/Bulgaria-EU_gray.png},alt=#{gui.countryselection.country.bg.logo.alt}"/></a> - <input type="submit" value="Bulgaria" th:attr="value=#{gui.countryselection.country.bg}" disabled> + <input type="submit" value="Bulgaria" th:attr="value=#{gui.countryselection.country.bg}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Croatia-EU_gray.png" alt="Croatia-eID" th:attr="src=@{/img/countries/Croatia-EU_gray.png},alt=#{gui.countryselection.country.hr.logo.alt}"/></a> - <input type="submit" value="Croatia" th:attr="value=#{gui.countryselection.country.hr}"> + <input type="submit" value="Croatia" th:attr="value=#{gui.countryselection.country.hr}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Cyprus-EU_gray.png" alt="Cyprus-eID" - th:attr="src=@{/img/countries/Cyprus-EU_gray.png},alt=#{gui.countryselection.country.cy.logo.alt}"/></a> - <input type="submit" value="Cyprus" th:attr="value=#{gui.countryselection.country.cy}" disabled> + th:attr="src=@{/img/countries/Cyprus-EU_gray.png},alt=#{gui.countryselection.country.cy.logo.alt}"/></a> + <input type="submit" value="Cyprus" th:attr="value=#{gui.countryselection.country.cy}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/CzechRepublic-EU_gray.png" alt="CzechRepublic-eID" th:attr="src=@{/img/countries/CzechRepublic-EU_gray.png},alt=#{gui.countryselection.country.cz.logo.alt}"/></a> - <input type="submit" value="CzechRepublic" th:attr="value=#{gui.countryselection.country.cz}"> + <input type="submit" value="CzechRepublic" th:attr="value=#{gui.countryselection.country.cz}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Denmark-EU_gray.png" alt="Denmark-eID" th:attr="src=@{/img/countries/Denmark-EU_gray.png},alt=#{gui.countryselection.country.dk.logo.alt}"/></a> - <input type="submit" value="Denmark" th:attr="value=#{gui.countryselection.country.dk}" disabled> + <input type="submit" value="Denmark" th:attr="value=#{gui.countryselection.country.dk}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Estonia-EU_gray.png" alt="Estonia-eID" th:attr="src=@{/img/countries/Estonia-EU_gray.png},alt=#{gui.countryselection.country.ee.logo.alt}"/></a> <input type="submit" value="Estonia" th:attr="value=#{gui.countryselection.country.ee}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Finland-EU_gray.png" alt="Finland-eID" th:attr="src=@{/img/countries/Finland-EU_gray.png},alt=#{gui.countryselection.country.fi.logo.alt}"/></a> <input type="submit" value="Finland" th:attr="value=#{gui.countryselection.country.fi}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/France-EU_gray.png" alt="France-eID" th:attr="src=@{/img/countries/France-EU_gray.png},alt=#{gui.countryselection.country.fr.logo.alt}"/></a> <input type="submit" value="France" th:attr="value=#{gui.countryselection.country.fr}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Greece-EU_gray.png" alt="Greece-eID" - th:attr="src=@{/img/countries/Greece-EU_gray.png},alt=#{gui.countryselection.country.gr.logo.alt}"/></a> - <input type="submit" value="Greece" th:attr="value=#{gui.countryselection.country.gr}" disabled> + th:attr="src=@{/img/countries/Greece-EU_gray.png},alt=#{gui.countryselection.country.gr.logo.alt}"/></a> + <input type="submit" value="Greece" th:attr="value=#{gui.countryselection.country.gr}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Hungary-EU_gray.png" alt="Hungary-eID" - th:attr="src=@{/img/countries/Hungary-EU_gray.png},alt=#{gui.countryselection.country.hu.logo.alt}"/></a> + th:attr="src=@{/img/countries/Hungary-EU_gray.png},alt=#{gui.countryselection.country.hu.logo.alt}"/></a> <input type="submit" value="Hungary" th:attr="value=#{gui.countryselection.country.hu}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Ireland-EU_gray.png" alt="Ireland-eID" th:attr="src=@{/img/countries/Ireland-EU_gray.png},alt=#{gui.countryselection.country.ir.logo.alt}"/></a> <input type="submit" value="Ireland" th:attr="value=#{gui.countryselection.country.ir}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Italy-EU_gray.png" alt="Italy-eID" th:attr="src=@{/img/countries/Italy-EU_gray.png},alt=#{gui.countryselection.country.it.logo.alt}"/></a> <input type="submit" value="Italy" th:attr="value=#{gui.countryselection.country.it}"> - <select id="testEnvironment" name="selectedEnvironment"> - <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> + <select id="testEnvironment" name="selectedEnvironment"> + <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> <option value="qs" th:text="#{gui.countryselection.mode.qs}">QS</option> <option value="test" th:text="#{gui.countryselection.mode.test}">Testing</option> <option value="dev" th:text="#{gui.countryselection.mode.dev}">Development</option> </select> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Latvia-EU_gray.png" alt="Latvia-eID" th:attr="src=@{/img/countries/Latvia-EU_gray.png},alt=#{gui.countryselection.country.lv.logo.alt}"/></a> - <input type="submit" value="Latvia" th:attr="value=#{gui.countryselection.country.lv}" disabled> + <input type="submit" value="Latvia" th:attr="value=#{gui.countryselection.country.lv}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Luxembourg-EU_gray.png" alt="Luxembourg-eID" th:attr="src=@{/img/countries/Luxembourg-EU_gray.png},alt=#{gui.countryselection.country.lu.logo.alt}"/></a> <input type="submit" value="Luxembourg" th:attr="value=#{gui.countryselection.country.lu}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Malta-EU_gray.png" alt="Malta-eID" th:attr="src=@{/img/countries/Malta-EU_gray.png},alt=#{gui.countryselection.country.mt.logo.alt}"/></a> <input type="submit" value="Malta" th:attr="value=#{gui.countryselection.country.mt}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Poland-EU_gray.png" alt="Poland-eID" th:attr="src=@{/img/countries/Poland-EU_gray.png},alt=#{gui.countryselection.country.pl.logo.alt}"/></a> <input type="submit" value="Poland" th:attr="value=#{gui.countryselection.country.pl}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Portugal-EU_gray.png" alt="Portugal-eID" - th:attr="src=@{/img/countries/Portugal-EU_gray.png},alt=#{gui.countryselection.country.pt.logo.alt}"/></a> - <input type="submit" value="Portugal" th:attr="value=#{gui.countryselection.country.pt}"> + th:attr="src=@{/img/countries/Portugal-EU_gray.png},alt=#{gui.countryselection.country.pt.logo.alt}"/></a> + <input type="submit" value="Portugal" th:attr="value=#{gui.countryselection.country.pt}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Romania-EU_gray.png" alt="Romania-eID" - th:attr="src=@{/img/countries/Romania-EU_gray.png},alt=#{gui.countryselection.country.ro.logo.alt}"/></a> - <input type="submit" value="Romania" th:attr="value=#{gui.countryselection.country.ro}" disabled> + th:attr="src=@{/img/countries/Romania-EU_gray.png},alt=#{gui.countryselection.country.ro.logo.alt}"/></a> + <input type="submit" value="Romania" th:attr="value=#{gui.countryselection.country.ro}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Slovakia-EU_gray.png" alt="Slovakia-eID" th:attr="src=@{/img/countries/Slovakia-EU_gray.png},alt=#{gui.countryselection.country.sk.logo.alt}"/></a> - <input type="submit" value="Slovakia" th:attr="value=#{gui.countryselection.country.sk}" disabled> + <input type="submit" value="Slovakia" th:attr="value=#{gui.countryselection.country.sk}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Slovenia-EU_gray.png" alt="Slovenia-eID" th:attr="src=@{/img/countries/Slovenia-EU_gray.png},alt=#{gui.countryselection.country.si.logo.alt}"/></a> - <input type="submit" value="Slovenia" th:attr="value=#{gui.countryselection.country.si}"> + <input type="submit" value="Slovenia" th:attr="value=#{gui.countryselection.country.si}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/Spain-EU_gray.png" alt="Spain-eID" th:attr="src=@{/img/countries/Spain-EU_gray.png},alt=#{gui.countryselection.country.es.logo.alt}"/></a> - <input type="submit" value="Spain" th:attr="value=#{gui.countryselection.country.es}"> - <select id="testEnvironment" name="selectedEnvironment"> - <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> + <input type="submit" value="Spain" th:attr="value=#{gui.countryselection.country.es}"> + <select id="testEnvironment" name="selectedEnvironment"> + <option value="prod" th:text="#{gui.countryselection.mode.prod}">Production</option> <option value="qs" th:text="#{gui.countryselection.mode.qs}">QS</option> <option value="test" th:text="#{gui.countryselection.mode.test}">Testing</option> <option value="dev" th:text="#{gui.countryselection.mode.dev}">Development</option> </select> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/Sweden-EU_gray.png" alt="Sweden-eID" th:attr="src=@{/img/countries/Sweden-EU_gray.png},alt=#{gui.countryselection.country.se.logo.alt}"/></a> - <input type="submit" value="Sweden" th:attr="value=#{gui.countryselection.country.se}" disabled> + <input type="submit" value="Sweden" th:attr="value=#{gui.countryselection.country.se}" disabled> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img class="countryimage" src="$contextPath/img/countries/TheNetherlands-EU_gray.jpg" alt="TheNetherlands-eID" - th:attr="src=@{/img/countries/TheNetherlands-EU_gray.jpg},alt=#{gui.countryselection.country.nl.logo.alt}"/></a> - <input type="submit" value="Netherlands" th:attr="value=#{gui.countryselection.country.nl}"> + th:attr="src=@{/img/countries/TheNetherlands-EU_gray.jpg},alt=#{gui.countryselection.country.nl.logo.alt}"/></a> + <input type="submit" value="Netherlands" th:attr="value=#{gui.countryselection.country.nl}"> </form> - + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> <a><img disabled class="countryimage" src="$contextPath/img/countries/UnitedKingdom-EU_gray.png" alt="UnitedKingdom-eID" th:attr="src=@{/img/countries/UnitedKingdom-EU_gray.png},alt=#{gui.countryselection.country.uk.logo.alt}"/></a> <input type="submit" value="United Kingdom" th:attr="value=#{gui.countryselection.country.uk}" disabled> </form> - + </div> - - <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> - <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancle}"> + + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" th:attr="value=#{gui.countryselection.cancel}"> <input type="hidden" name="stopAuthProcess" value="true" > <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> </form> - + </div> </body> </html> diff --git a/connector/src/test/resources/config/templates/other_login_method.html b/connector/src/test/resources/config/templates/other_login_method.html new file mode 100644 index 00000000..56c368c6 --- /dev/null +++ b/connector/src/test/resources/config/templates/other_login_method.html @@ -0,0 +1,251 @@ +<!DOCTYPE html> +<html xmlns:th="http://www.thymeleaf.org" + xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" + layout:decorator="fragments/base" + th:with="lang=${#locale.language}" th:lang="${lang}"> +<head> + <meta content="text/html; charset=utf-8" http-equiv="Content-Type"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="$contextPath/static/css/css_country.css" th:href="@{/static/css/css_country.css}"/> + <title th:text="#{gui.countryselection.title}">eIDAS-Login Login-Auswahl</title> + <script type="text/javascript"> + </script> + <style> + body { + background-image: none; + margin: 0px; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + } + + div.header { + background-color: #e9ecef; + padding-top: 28px; + padding-left: 137px; + padding-right: 137px; + padding-bottom: 12px; + } + + div.titlebar { + padding: 0px; + } + + div.titlebar div { + } + + .hidden { + display: none; + } + + ul.nav_oben { + padding: 0px; + margin: 0px; + text-align: right; + text-transform: uppercase; + } + + li { + display: inline-block; + } + + div.header a { + text-decoration: none; + color: black; + } + + a { + text-decoration: none; + color: #a22c1c; + } + + .block { + /* override country.css */ + width: 200px; + padding-bottom: 20px; + } + + @media only screen and (min-width: 1000px) { + div.header { + padding-left: 137px; + padding-right: 137px; + } + + .content { + padding-left: 137px; + padding-right: 137px; + } + + footer { + padding-left: 137px; + padding-right: 137px; + } + } + + @media only screen and (max-width: 999px) { + div.header { + padding-left: 1em; + padding-right: 1em; + } + + .content { + padding-left: 1em; + padding-right: 1em; + } + + footer { + padding-left: 1em; + padding-right: 1em; + } + } + + div.subtitle h1 { + padding: 0px; + margin: 0px; + font-size: 130%; + align: right; + } + + div.subtitle h2 { + padding: 0px; + margin: 0px; + font-size: 115%; + } + + footer { + left: 0; + padding-top: 1em; + bottom: 0; + width: 100%; + height: 2em; + background-color: rgb(162, 44, 28); + color: white; + } + + .float { + float: left; + } + + .floatright { + float: right; + } + + .copyright { + width: 66%; + font-size: 80%; + } + + #countries { + padding-bottom: 40px; + } + + #country { + padding-bottom: 20px; + } + + input[type=submit] { + width: inherit; + /* text-align: left; */ + } + + form { + justify-content: center; + } + </style> + <script type="text/javascript"> + + /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/ + if (!Element.prototype.matches) + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + + if (!Element.prototype.closest) + Element.prototype.closest = function (s) { + var el = this; + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + return null; + }; + + + function clickCountryFlag(element) { + if (!element) return false; + + var form = element.closest("form"); + + if (!form) return false; + + form.submit(); + return false; + } + </script> +</head> +<body> +<div class="header container"> + <div class="titlebar"> + <div> + <a href="https://www.bmi.gv.at/" target="_blank" title="Home"> + <img class="toplogo img-responsive" src="/static/BMI.png" alt="Logo BMI" + th:attr="alt=#{gui.countryselection.logo.bmi.alt}"> + <h1 class="hidden" th:text="#{gui.countryselection.header1}"> Bundesministerium für Inneres </h1> + </a> + </div> + <ul class="nav_oben"> + <li> + <div class="languageselection" th:include="language_selection :: selectlanguage"> + LanguageSelectionBlock + </div> + </li> + + <li><a href="https://www.bmi.gv.at/" target="_blank" th:text="#{gui.countryselection.link.bmi}"> Startseite + BMI </a></li> + </ul> + </div> +</div> +<div class="content"> + <div class="subtitle"> + <h1 th:text="#{gui.countryselection.header2}"> Zentraler eIDAS Knoten der Republik Österreich </h1> + <h2 th:text="#{gui.countryselection.header3}"> Betrieben durch das Bundesministerium für Inneres </h2> + </div> + + <h1 th:text="#{gui.countryselection.header.selection}"> Wählen Sie Ihr Land / Select your country </h1> + + <div id="country"> + <!-- Active countries --> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" role="button" value="Handy-Signatur / Mobile Signature" + th:attr="value=#{gui.countryselection.country.de}"/> + <input type="hidden" name="selectedCountry" value="HS"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> + </form> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" role="button" value="Andere eIDAS ID" + th:attr="value=#{gui.countryselection.country.de}"/> + <input type="hidden" name="selectedCountry" value="EIDAS"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> + </form> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" role="button" value="Keine weitere HS / eIDAS" + th:attr="value=#{gui.countryselection.country.de}"/> + <input type="hidden" name="selectedCountry" value="NONE"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"/> + </form> + <!-- todo wohnsitz --> + </div> + + <!-- Abbrechen Button --> + <form class="block" method="post" action="$contextPath$submitEndpoint" th:attr="action=@{${submitEndpoint}}"> + <input type="submit" class="btn btn-outline-primary btn-block" value="Abbrechen/Cancel" + th:attr="value=#{gui.countryselection.cancel}"> + <input type="hidden" name="stopAuthProcess" value="true"> + <input type="hidden" name="pendingid" value="$pendingid" th:attr="value=${pendingid}"> + </form> + +</div> +<footer> + <div class="copyright">© BUNDESMINISTERIUM FÜR INNERES</div> + <div></div> +</footer> +</body> +</html> diff --git a/connector/src/test/resources/spring/SpringTest_connector.beans.xml b/connector/src/test/resources/spring/SpringTest_connector.beans.xml index 4d770570..81fff7dd 100644 --- a/connector/src/test/resources/spring/SpringTest_connector.beans.xml +++ b/connector/src/test/resources/spring/SpringTest_connector.beans.xml @@ -15,8 +15,11 @@ <mvc:annotation-driven /> <mvc:default-servlet-handler /> + <bean id="defaultErrorTicketService" + class="at.gv.egiz.eaaf.core.impl.idp.auth.services.DefaultErrorService"/> + <bean id="WebResourceConfiguration" - class="at.asitplus.eidas.specific.connector.config.StaticResourceConfiguration" /> + class="at.asitplus.eidas.specific.connector.gui.config.StaticResourceConfiguration" /> <bean id="ProcessEngineSignalController" class="at.asitplus.eidas.specific.connector.controller.ProcessEngineSignalController" /> @@ -38,19 +41,16 @@ <bean id="PVP2XProtocol" class="at.asitplus.eidas.specific.connector.controller.Pvp2SProfileEndpoint"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> - <property name="metadataProvider"> - <ref bean="PVPMetadataProvider" /> - </property> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> + <property name="metadataProvider" ref="PVPMetadataProvider" /> </bean> <bean id="AuthnRequestValidator" class="at.asitplus.eidas.specific.connector.verification.AuthnRequestValidator" /> - <bean id="SAMLVerificationEngine" - class="at.gv.egiz.eaaf.modules.pvp2.impl.verification.SamlVerificationEngine" /> + <!-- bean id="SAMLVerificationEngine" + class="at.gv.egiz.eaaf.modules.pvp2.impl.verification.SamlVerificationEngine" /--> + <bean id="pvpMetadataService" class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.MetadataAction"> @@ -61,12 +61,8 @@ <bean id="PVPAuthenticationRequestAction" class="at.gv.egiz.eaaf.modules.pvp2.idp.impl.AuthenticationAction"> - <property name="pvpIdpCredentials"> - <ref bean="PVPEndPointCredentialProvider" /> - </property> - <property name="metadataProvider"> - <ref bean="PVPMetadataProvider" /> - </property> + <property name="pvpIdpCredentials" ref="PVPEndPointCredentialProvider" /> + <property name="metadataProvider" ref="PVPMetadataProvider" /> </bean> <bean id="eaafProtocolAuthenticationService" @@ -74,9 +70,6 @@ <property name="guiBuilder" ref="mvcGUIBuilderImpl" /> </bean> - <bean id="defaultErrorHandler" - class="at.gv.egiz.eaaf.core.impl.idp.auth.services.DefaultErrorService"/> - <bean id="securePendingRequestIdGeneration" class="at.gv.egiz.eaaf.core.impl.utils.SecurePendingRequestIdGenerationStrategy" /> |