diff options
Diffstat (limited to 'id/server/idserverlib/src/main/java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java index 6ef85d7ae..db3e12f43 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/AuthenticationRequest.java @@ -4,6 +4,7 @@ import at.gv.egovernment.moa.id.auth.data.AuthenticationSession; import at.gv.egovernment.moa.id.auth.exception.AuthenticationException; import at.gv.egovernment.moa.id.auth.exception.MOAIDException; import at.gv.egovernment.moa.id.auth.stork.VelocityProvider; +import at.gv.egovernment.moa.id.commons.db.dao.config.StorkAttribute; import at.gv.egovernment.moa.id.config.auth.AuthConfigurationProvider; import at.gv.egovernment.moa.id.config.auth.OAAuthParameter; import at.gv.egovernment.moa.id.moduls.IAction; @@ -64,7 +65,7 @@ public class AuthenticationRequest implements IAction { Logger.debug("STORK QAA 2 :" + ((MOASTORKAuthnRequest) req).getStorkAuthnRequest().getQAALevel()); StartAuthResponse startAuthResponse = getStartAuthResponse(((MOASTORKAuthnRequest) req).getStorkAuthnRequest()); - HttpSession httpSession = httpReq.getSession(); + HttpSession httpSession = httpReq.getSession(); performRed httpSession.setAttribute("STORKSessionID", "12345"); httpResp.setStatus(startAuthResponse.getHttpStatusCode()); try { @@ -102,12 +103,37 @@ public class AuthenticationRequest implements IAction { throw new AuthenticationException("stork.12", new Object[] { moasession.getPublicOAURLPrefix() }); + // Prepare basic AT attributes + try { + IPersonalAttributeList moaAttrList = moasession.getStorkAttributes(); + Logger.info("Found number of moa personal attributes: " + moasession.getStorkAttributes().size()); + + + for (PersonalAttribute personalAttribute : moaAttrList) { + Logger.info("Personal attribute found: " + personalAttribute.getName() + personalAttribute.getStatus()); + if (personalAttribute.getValue().size() > 0) { + for (String value : personalAttribute.getValue()) { + Logger.info(" Value found: " + value); + } + } + } + + } catch (Exception e) { + Logger.error("Exception, attributes: " + e.getMessage()); + } + + authnResponse.setPersonalAttributeList(populateAttributes()); + + // Prepare extended attributes + Logger.debug("Preparing data container"); + //httpResp.setStatus(200); //VPEPSInboundPostHandler // create fresh container DataContainer container = new DataContainer(); - + + // - fill in the request we extracted above container.setRequest(((MOASTORKAuthnRequest) req).getStorkAuthnRequest()); @@ -118,39 +144,20 @@ public class AuthenticationRequest implements IAction { container.setTarget(((MOASTORKAuthnRequest) req).getStorkAuthnRequest().getAssertionConsumerServiceURL()); + Logger.debug("Data container prepared"); - if (1==1) // test + if (1==0) // test // see if we need to fetch further attributes return (new AttributeCollector()).processRequest(container, httpReq, httpResp, oaParam); + Logger.debug("Finished sending data container"); - - try { - IPersonalAttributeList moaAttrList = moasession.getStorkAttributes(); - Logger.info("Found number of moa personal attributes: " + moasession.getStorkAttributes().size()); - - - for (PersonalAttribute personalAttribute : moaAttrList) { - Logger.info("Personal attribute found: " + personalAttribute.getName() + personalAttribute.getStatus()); - if (personalAttribute.getValue().size() > 0) { - for (String value : personalAttribute.getValue()) { - Logger.info(" Value found: " + value); - } - } - } - - } catch (Exception e) { - Logger.error("Exception, attributes: " + e.getMessage()); - } - - authnResponse.setPersonalAttributeList(populateAttributes()); - try { //Get SAMLEngine instance STORKSAMLEngine engine = STORKSAMLEngine.getInstance("incoming"); |