aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java')
-rw-r--r--id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java27
1 files changed, 26 insertions, 1 deletions
diff --git a/id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java b/id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java
index f3eaff11a..eeef68c3e 100644
--- a/id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java
+++ b/id/server/modules/moa-id-module-AT_eIDAS_connector/src/main/java/at/gv/egovernment/moa/id/auth/modules/eIDAScentralAuth/tasks/ReceiveAuthnResponseTask.java
@@ -23,6 +23,7 @@
package at.gv.egovernment.moa.id.auth.modules.eIDAScentralAuth.tasks;
import java.io.IOException;
+import java.util.Arrays;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
@@ -64,6 +65,7 @@ import at.gv.egovernment.moa.id.auth.modules.eIDAScentralAuth.utils.EidasCentral
import at.gv.egovernment.moa.id.auth.modules.eIDAScentralAuth.utils.Utils;
import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
+import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
import at.gv.egovernment.moa.id.protocols.pvp2x.verification.SAMLVerificationEngineSP;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.MiscUtil;
@@ -148,6 +150,9 @@ public class ReceiveAuthnResponseTask extends AbstractAuthServletTask {
getAuthDataFromInterfederation(extractor, pendingReq.getServiceProviderConfiguration(IOAAuthParameters.class));
+ //set NeedConsent to false, because user gives consont during authentication
+ pendingReq.setNeedUserConsent(false);
+
//store pending-request
requestStoreage.storePendingRequest(pendingReq);
@@ -194,7 +199,7 @@ public class ReceiveAuthnResponseTask extends AbstractAuthServletTask {
throw new AssertionValidationExeption("sp.pvp2.06", new Object[]{EidasCentralAuthConstants.MODULE_NAME_FOR_LOGGING});
}
-
+
//copy attributes into MOASession
AuthenticationSessionWrapper session = pendingReq.getSessionData(AuthenticationSessionWrapper.class);
Set<String> includedAttrNames = extractor.getAllIncludeAttributeNames();
@@ -207,12 +212,32 @@ public class ReceiveAuthnResponseTask extends AbstractAuthServletTask {
//set foreigner flag
session.setForeigner(true);
+
+ //set CCE URL
if (extractor.getFullAssertion().getIssuer() != null &&
StringUtils.isNotEmpty(extractor.getFullAssertion().getIssuer().getValue()))
session.setBkuURL(extractor.getFullAssertion().getIssuer().getValue());
else
session.setBkuURL("eIDAS_Authentication");
+ if (authConfig.getBasicConfigurationBoolean(EidasCentralAuthConstants.CONFIG_PROPS_SEMPER_MANDATES_ACTIVE, false)) {
+ if (extractor.containsAttribute(PVPConstants.MANDATE_TYPE_NAME)) {
+ Logger.trace("Check attributes in SEMPER eIDAS mode.");
+ if (!extractor.containsAllRequiredAttributes(Arrays.asList(
+ PVPConstants.MANDATE_LEG_PER_SOURCE_PIN_NAME,
+ PVPConstants.MANDATE_LEG_PER_SOURCE_PIN_TYPE_NAME,
+ PVPConstants.MANDATE_LEG_PER_FULL_NAME_NAME))) {
+ Logger.warn("PVP Response from 'ms-specific eIDAS node' contains not all required attributes for eIDAS SEMPER process.");
+ throw new AssertionValidationExeption("sp.pvp2.06", new Object[]{EidasCentralAuthConstants.MODULE_NAME_FOR_LOGGING});
+
+ }
+
+ Logger.info("SEMPER mode is active and mandates are found. Activing mandates for eIDAS login ... ");
+ session.setUseMandates(true);
+
+ }
+ }
+
} catch (AssertionValidationExeption e) {
throw new BuildException("builder.06", null, e);