diff options
Diffstat (limited to 'id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/AuthenticationServer.java | 56 |
1 files changed, 47 insertions, 9 deletions
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 d783c74d9..afe0bd1d6 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 @@ -117,6 +117,7 @@ import at.gv.egovernment.moa.id.config.auth.VerifyInfoboxParameters; import at.gv.egovernment.moa.id.config.stork.CPEPS; import at.gv.egovernment.moa.id.config.stork.STORKConfig; import at.gv.egovernment.moa.id.data.AuthenticationData; +import at.gv.egovernment.moa.id.moduls.AuthenticationSessionStore; import at.gv.egovernment.moa.id.util.HTTPUtils; import at.gv.egovernment.moa.id.util.MOAIDMessageProvider; import at.gv.egovernment.moa.id.util.Random; @@ -385,7 +386,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { public String startAuthentication(String authURL, String target, String targetFriendlyName, String oaURL, String templateURL, String bkuURL, String useMandate, String sessionID, String scheme, - String sourceID) throws WrongParametersException, + String sourceID, String modul, String action) throws WrongParametersException, AuthenticationException, ConfigurationException, BuildException { String useMandateString = null; @@ -455,6 +456,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { session.setAuthURL(authURL); session.setTemplateURL(templateURL); session.setBusinessService(oaParam.getBusinessService()); + session.setModul(modul); + session.setAction(action); if (sourceID != null) session.setSourceID(sourceID); } @@ -1941,6 +1944,14 @@ public class AuthenticationServer implements MOAIDAuthConstants { return null; } else { + session.setAuthData(authData); + + String newMOASessionID = AuthenticationSessionStore.changeSessionID(session); + Logger.info("Changed MOASession " + sessionID + " to Session " + newMOASessionID); + Logger.info("Daten angelegt zu MOASession " + newMOASessionID); + + return newMOASessionID; + /* String samlAssertion = new AuthenticationDataAssertionBuilder() .build(authData, session.getAssertionPrPerson(), session .getAssertionAuthBlock(), session @@ -1973,7 +1984,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.info("Anmeldedaten zu MOASession " + sessionID + " angelegt, SAML Artifakt " + samlArtifact); return samlArtifact; - + */ } } @@ -2132,6 +2143,15 @@ public class AuthenticationServer implements MOAIDAuthConstants { new Object[] { GET_MIS_SESSIONID }); } + session.setAuthData(authData); + session.setMandateData(mandateData); + + String newMOASessionID = AuthenticationSessionStore.changeSessionID(session); + Logger.info("Changed MOASession " + sessionID + " to Session " + newMOASessionID); + Logger.info("Daten angelegt zu MOASession " + newMOASessionID); + return newMOASessionID; + + /* String samlAssertion = new AuthenticationDataAssertionBuilder() .buildMandate(authData, session.getAssertionPrPerson(), mandateData, session.getAssertionAuthBlock(), session @@ -2164,7 +2184,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { sessionStore.remove(sessionID); Logger.info("Anmeldedaten zu MOASession " + sessionID + " angelegt, SAML Artifakt " + samlArtifact); - return samlArtifact; + return samlArtifact;*/ } @@ -2287,7 +2307,15 @@ public class AuthenticationServer implements MOAIDAuthConstants { int conditionLength = oaParam.getConditionLength(); AuthenticationData authData = buildAuthenticationData(session, vsresp, useUTC, true); - + + session.setAuthData(authData); + + String newMOASessionID = AuthenticationSessionStore.changeSessionID(session); + Logger.info("Changed MOASession " + sessionID + " to Session " + newMOASessionID); + Logger.info("Daten angelegt zu MOASession " + newMOASessionID); + return newMOASessionID; + //TODO: regenerate MOASession ID! + /* String samlAssertion = new AuthenticationDataAssertionBuilder().build( authData, session.getAssertionPrPerson(), session .getAssertionAuthBlock(), session @@ -2319,7 +2347,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { Logger.info("Anmeldedaten zu MOASession " + sessionID + " angelegt, SAML Artifakt " + samlArtifact); - return samlArtifact; + return samlArtifact;*/ } /** @@ -2550,6 +2578,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ private static AuthenticationSession newSession() throws AuthenticationException { + + return AuthenticationSessionStore.createSession(); + + /* String sessionID = Random.nextRandom(); AuthenticationSession newSession = new AuthenticationSession(sessionID); synchronized (sessionStore) { @@ -2560,7 +2592,7 @@ public class AuthenticationServer implements MOAIDAuthConstants { new Object[] { sessionID }); sessionStore.put(sessionID, newSession); } - return newSession; + return newSession;*/ } /** @@ -2573,8 +2605,10 @@ public class AuthenticationServer implements MOAIDAuthConstants { */ public static AuthenticationSession getSession(String id) throws AuthenticationException { - AuthenticationSession session = (AuthenticationSession) sessionStore - .get(id); + + AuthenticationSession session = AuthenticationSessionStore.getSession(id); + /*(AuthenticationSession) sessionStore + .get(id);*/ if (session == null) throw new AuthenticationException("auth.02", new Object[] { id }); return session; @@ -2781,7 +2815,9 @@ public class AuthenticationServer implements MOAIDAuthConstants { String target, String targetFriendlyName, String authURL, - String sourceID) throws MOAIDException, AuthenticationException, WrongParametersException, ConfigurationException { + String sourceID, + String modul, + String action) throws MOAIDException, AuthenticationException, WrongParametersException, ConfigurationException { //read configuration paramters of OA OAAuthParameter oaParam = AuthConfigurationProvider.getInstance().getOnlineApplicationParameter(oaURL); @@ -2805,6 +2841,8 @@ public class AuthenticationServer implements MOAIDAuthConstants { moaSession.setAuthURL(authURL); moaSession.setBusinessService(oaParam.getBusinessService()); moaSession.setDomainIdentifier(oaParam.getIdentityLinkDomainIdentifier()); + moaSession.setAction(action); + moaSession.setModul(modul); if (sourceID != null) moaSession.setSourceID(sourceID); |