diff options
Diffstat (limited to 'id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java')
-rw-r--r-- | id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java index b44863b80..8f22c6ffc 100644 --- a/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java +++ b/id/server/modules/moa-id-module-ehvd_integration/src/main/java/at/gv/egovernment/moa/id/auth/modules/ehvd/task/InjectEhvdInformationTask.java @@ -31,16 +31,14 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; import at.gv.egiz.eaaf.core.exceptions.TaskExecutionException; -import at.gv.egiz.eaaf.core.impl.data.Pair; -import at.gv.egiz.eaaf.core.impl.idp.auth.builder.BPKBuilder; import at.gv.egiz.eaaf.core.impl.idp.auth.modules.AbstractAuthServletTask; import at.gv.egovernment.moa.id.auth.data.AuthenticationSessionWrapper; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.modules.ehvd.service.IEhvdCommunication; import at.gv.egovernment.moa.id.commons.api.exceptions.MOAIDException; -import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants; import at.gv.egovernment.moa.logging.Logger; /** @@ -50,8 +48,9 @@ import at.gv.egovernment.moa.logging.Logger; @Component("InjectEhvdInformationTask") public class InjectEhvdInformationTask extends AbstractAuthServletTask { - @Autowired IEhvdCommunication ehvdService; - + @Autowired + IEhvdCommunication ehvdService; + /* * (non-Javadoc) * @@ -66,17 +65,19 @@ public class InjectEhvdInformationTask extends AbstractAuthServletTask { HttpServletResponse response) throws TaskExecutionException { try { - final AuthenticationSessionWrapper session = pendingReq.getSessionData(AuthenticationSessionWrapper.class); - + final AuthenticationSessionWrapper session = pendingReq.getSessionData( + AuthenticationSessionWrapper.class); + // validate internal state validateInternalState(session); - + // requesting roles from EHVD - List<String> ehvdRoles = ehvdService.getRoles(session.getIdentityLink()); - - // inject EHVD roles - session.setGenericDataToSession(PVPConstants.ROLES_NAME, StringUtils.join(ehvdRoles, ";")); - + final List<String> ehvdRoles = ehvdService.getRoles(session.getIdentityLink()); + + // inject EHVD roles + session.setGenericDataToSession(PVPAttributeDefinitions.ROLES_NAME, + StringUtils.join(ehvdRoles, ";")); + // store MOASession into database requestStoreage.storePendingRequest(pendingReq); @@ -90,14 +91,13 @@ public class InjectEhvdInformationTask extends AbstractAuthServletTask { } private void validateInternalState(AuthenticationSessionWrapper session) throws AuthenticationException { - //check if identityLink is available - if (session.getIdentityLink() == null ) { + // check if identityLink is available + if (session.getIdentityLink() == null) { Logger.error("No IdentityLink in session. There is an internal error in process definition"); throw new AuthenticationException("process.04", null); - + } - - + } } |