From 82ffa96de19042902562e05aa5d903ea188ebfdf Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Mon, 8 Jul 2013 16:10:24 +0200 Subject: =?UTF-8?q?Bugfix:=20Zertifikatsspeicherung=20f=C3=BCr=20ForeignID?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- id/oa/.settings/org.eclipse.jdt.core.prefs | 12 +- .../org.eclipse.wst.common.project.facet.core.xml | 4 +- id/oa/.settings/org.maven.ide.eclipse.prefs | 1 - .../.settings/org.eclipse.wst.common.component | 14 +- .../org.eclipse.wst.common.project.facet.core.xml | 4 +- .../auth/.settings/org.maven.ide.eclipse.prefs | 1 - .../.settings/org.eclipse.wst.common.component | 8 +- .../.settings/org.maven.ide.eclipse.prefs | 1 - .../moa/id/auth/AuthenticationServer.java | 13 +- .../moa/id/auth/servlet/GetForeignIDServlet.java | 17 +- .../moa/id/auth/servlet/PEPSConnectorServlet.java | 13 +- .../id/auth/servlet/VerifyCertificateServlet.java | 22 +- id/server/moa-id-commons/.classpath | 2 +- .../.settings/org.eclipse.wst.common.component | 295 ++++++++++++++++++++- .../proxy/.settings/org.maven.ide.eclipse.prefs | 1 - 15 files changed, 342 insertions(+), 66 deletions(-) (limited to 'id') diff --git a/id/oa/.settings/org.eclipse.jdt.core.prefs b/id/oa/.settings/org.eclipse.jdt.core.prefs index f2c34578f..dc0892a32 100644 --- a/id/oa/.settings/org.eclipse.jdt.core.prefs +++ b/id/oa/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ -#Tue Jul 17 08:40:59 CEST 2012 eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.3 +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/id/oa/.settings/org.eclipse.wst.common.project.facet.core.xml b/id/oa/.settings/org.eclipse.wst.common.project.facet.core.xml index a801c94a0..73c938daf 100644 --- a/id/oa/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/id/oa/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -3,5 +3,5 @@ - - \ No newline at end of file + + diff --git a/id/oa/.settings/org.maven.ide.eclipse.prefs b/id/oa/.settings/org.maven.ide.eclipse.prefs index b6ca61b99..7f28ca3cd 100644 --- a/id/oa/.settings/org.maven.ide.eclipse.prefs +++ b/id/oa/.settings/org.maven.ide.eclipse.prefs @@ -1,4 +1,3 @@ -#Tue Jul 07 16:06:56 CEST 2009 activeProfiles= eclipse.preferences.version=1 fullBuildGoals=process-test-resources diff --git a/id/server/auth/.settings/org.eclipse.wst.common.component b/id/server/auth/.settings/org.eclipse.wst.common.component index d9c09d9ad..fa80111cf 100644 --- a/id/server/auth/.settings/org.eclipse.wst.common.component +++ b/id/server/auth/.settings/org.eclipse.wst.common.component @@ -1,19 +1,15 @@ - - + - + uses - + uses - + uses - - uses - - + uses diff --git a/id/server/auth/.settings/org.eclipse.wst.common.project.facet.core.xml b/id/server/auth/.settings/org.eclipse.wst.common.project.facet.core.xml index 564572b10..ac59587b0 100644 --- a/id/server/auth/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/id/server/auth/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -2,6 +2,6 @@ - - \ No newline at end of file + + diff --git a/id/server/auth/.settings/org.maven.ide.eclipse.prefs b/id/server/auth/.settings/org.maven.ide.eclipse.prefs index a45f64227..7f28ca3cd 100644 --- a/id/server/auth/.settings/org.maven.ide.eclipse.prefs +++ b/id/server/auth/.settings/org.maven.ide.eclipse.prefs @@ -1,4 +1,3 @@ -#Tue Jul 07 16:07:00 CEST 2009 activeProfiles= eclipse.preferences.version=1 fullBuildGoals=process-test-resources diff --git a/id/server/idserverlib/.settings/org.eclipse.wst.common.component b/id/server/idserverlib/.settings/org.eclipse.wst.common.component index de749d201..8f3380621 100644 --- a/id/server/idserverlib/.settings/org.eclipse.wst.common.component +++ b/id/server/idserverlib/.settings/org.eclipse.wst.common.component @@ -1,8 +1,8 @@ - - + - + + - \ No newline at end of file + diff --git a/id/server/idserverlib/.settings/org.maven.ide.eclipse.prefs b/id/server/idserverlib/.settings/org.maven.ide.eclipse.prefs index 3f907cfa1..7f28ca3cd 100644 --- a/id/server/idserverlib/.settings/org.maven.ide.eclipse.prefs +++ b/id/server/idserverlib/.settings/org.maven.ide.eclipse.prefs @@ -1,4 +1,3 @@ -#Tue Jul 07 16:06:59 CEST 2009 activeProfiles= eclipse.preferences.version=1 fullBuildGoals=process-test-resources diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java index ba66041d7..19af66150 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java @@ -2269,17 +2269,17 @@ public class AuthenticationServer implements MOAIDAuthConstants { * @return SAML artifact needed for retrieving authentication data, encoded * BASE64 */ - public String getForeignAuthenticationData(String sessionID) + public String getForeignAuthenticationData(AuthenticationSession session) throws AuthenticationException, BuildException, ParseException, ConfigurationException, ServiceException, ValidateException { //TODO: CHECK if STORK parts works correct!!!! - if (isEmpty(sessionID)) + if (session == null) throw new AuthenticationException("auth.10", new Object[] { REQ_VERIFY_AUTH_BLOCK, PARAM_SESSIONID }); - AuthenticationSession session = getSession(sessionID); + //AuthenticationSession session = getSession(sessionID); // AuthConfigurationProvider authConf = // AuthConfigurationProvider.getInstance(); @@ -2348,12 +2348,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { vsresp.setX509certificate(null); session.setForeigner(true); - //session is implicit stored in changeSessionID!!!! - String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(session); - - Logger.info("Changed MOASession " + sessionID + " to Session " + newMOASessionID); - Logger.info("Daten angelegt zu MOASession " + newMOASessionID); - return newMOASessionID; + return "new Session"; //TODO: regenerate MOASession ID! /* diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java index 935edb557..d49f4e215 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/GetForeignIDServlet.java @@ -179,7 +179,15 @@ public class GetForeignIDServlet extends AuthServlet { session.setIdentityLink(identitylink); String samlArtifactBase64 = - AuthenticationServer.getInstance().getForeignAuthenticationData(sessionID); + AuthenticationServer.getInstance().getForeignAuthenticationData(session); + + + //session is implicit stored in changeSessionID!!!! + String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(session); + + Logger.info("Changed MOASession " + sessionID + " to Session " + newMOASessionID); + Logger.info("Daten angelegt zu MOASession " + newMOASessionID); + if (!samlArtifactBase64.equals("Redirect to Input Processor")) { /*redirectURL = session.getOAURLRequested(); if (!session.getBusinessService()) { @@ -188,11 +196,12 @@ public class GetForeignIDServlet extends AuthServlet { redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); redirectURL = resp.encodeRedirectURL(redirectURL);*/ redirectURL = new DataURLBuilder().buildDataURL(session.getAuthURL(), - ModulUtils.buildAuthURL(session.getModul(), session.getAction()), samlArtifactBase64); + ModulUtils.buildAuthURL(session.getModul(), session.getAction()), newMOASessionID); redirectURL = resp.encodeRedirectURL(redirectURL); - } else { - redirectURL = new DataURLBuilder().buildDataURL(session.getAuthURL(), AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, session.getSessionID()); + } else { + redirectURL = new DataURLBuilder().buildDataURL(session.getAuthURL(), AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, newMOASessionID); + } try { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java index 3c8892e33..63bc2a8cc 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/PEPSConnectorServlet.java @@ -196,9 +196,15 @@ public class PEPSConnectorServlet extends AuthServlet { Logger.debug("Starting to assemble MOA assertion"); //produce MOA-Assertion and artifact String samlArtifactBase64 = - AuthenticationServer.getInstance().getForeignAuthenticationData(moaSessionID); + AuthenticationServer.getInstance().getForeignAuthenticationData(moaSession); Logger.info("MOA assertion assembled and SAML Artifact generated."); + //session is implicit stored in changeSessionID!!!! + String newMOASessionID = AuthenticationSessionStoreage.changeSessionID(moaSession); + + Logger.info("Changed MOASession " + moaSessionID + " to Session " + newMOASessionID); + Logger.info("Daten angelegt zu MOASession " + newMOASessionID); + //redirect String redirectURL = null; if (!samlArtifactBase64.equals("Redirect to Input Processor")) { @@ -209,10 +215,11 @@ public class PEPSConnectorServlet extends AuthServlet { redirectURL = addURLParameter(redirectURL, PARAM_SAMLARTIFACT, URLEncoder.encode(samlArtifactBase64, "UTF-8")); redirectURL = response.encodeRedirectURL(redirectURL);*/ redirectURL = new DataURLBuilder().buildDataURL(moaSession.getAuthURL(), - ModulUtils.buildAuthURL(moaSession.getModul(), moaSession.getAction()), samlArtifactBase64); + ModulUtils.buildAuthURL(moaSession.getModul(), moaSession.getAction()), newMOASessionID); redirectURL = response.encodeRedirectURL(redirectURL); } else { - redirectURL = new DataURLBuilder().buildDataURL(moaSession.getAuthURL(), AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, moaSession.getSessionID()); + + redirectURL = new DataURLBuilder().buildDataURL(moaSession.getAuthURL(), AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, newMOASessionID); } try { diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java index 7b5c1513a..e07be8420 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/servlet/VerifyCertificateServlet.java @@ -144,6 +144,12 @@ public class VerifyCertificateServlet extends AuthServlet { // verify certificate for OrganWalter String createXMLSignatureRequestOrRedirect = AuthenticationServer.getInstance().verifyCertificate(session, cert); + try { + AuthenticationSessionStoreage.storeSession(session); + } catch (MOADatabaseException e) { + throw new MOAIDException("session store error", null); + } + ServletUtils.writeCreateXMLSignatureRequestOrRedirect(resp, session, createXMLSignatureRequestOrRedirect, AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, "VerifyIdentityLink"); } else { @@ -156,19 +162,19 @@ public class VerifyCertificateServlet extends AuthServlet { session.getAuthURL(), REQ_GET_FOREIGN_ID, session.getSessionID()); - + + try { + AuthenticationSessionStoreage.storeSession(session); + } catch (MOADatabaseException e) { + throw new MOAIDException("session store error", null); + } + ServletUtils.writeCreateXMLSignatureRequest(resp, session, createXMLSignatureRequest, AuthenticationServer.REQ_PROCESS_VALIDATOR_INPUT, "GetForeignID", dataurl); Logger.debug("Send CreateXMLSignatureRequest to BKU"); } - - try { - AuthenticationSessionStoreage.storeSession(session); - } catch (MOADatabaseException e) { - throw new MOAIDException("session store error", null); - } - + } catch (MOAIDException ex) { handleError(null, ex, req, resp); diff --git a/id/server/moa-id-commons/.classpath b/id/server/moa-id-commons/.classpath index a3f1bdc53..8b5a9fa96 100644 --- a/id/server/moa-id-commons/.classpath +++ b/id/server/moa-id-commons/.classpath @@ -25,8 +25,8 @@ + - diff --git a/id/server/proxy/.settings/org.eclipse.wst.common.component b/id/server/proxy/.settings/org.eclipse.wst.common.component index fa97f3880..6570beb50 100644 --- a/id/server/proxy/.settings/org.eclipse.wst.common.component +++ b/id/server/proxy/.settings/org.eclipse.wst.common.component @@ -1,20 +1,287 @@ - + - - uses - - - uses - - - uses - - - uses - + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + + + uses + - + \ No newline at end of file diff --git a/id/server/proxy/.settings/org.maven.ide.eclipse.prefs b/id/server/proxy/.settings/org.maven.ide.eclipse.prefs index 3f907cfa1..7f28ca3cd 100644 --- a/id/server/proxy/.settings/org.maven.ide.eclipse.prefs +++ b/id/server/proxy/.settings/org.maven.ide.eclipse.prefs @@ -1,4 +1,3 @@ -#Tue Jul 07 16:06:59 CEST 2009 activeProfiles= eclipse.preferences.version=1 fullBuildGoals=process-test-resources -- cgit v1.2.3