aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2018-06-14 16:30:49 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2018-06-14 16:30:49 +0200
commit6b38531ef2a829e3dab513ae8c679511a848421d (patch)
treed783a3e7cef0e5c0154e49766be2d56a52644894 /id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
parent3b26a365d832d4b0664777d2c348606247022564 (diff)
downloadmoa-id-spss-6b38531ef2a829e3dab513ae8c679511a848421d.tar.gz
moa-id-spss-6b38531ef2a829e3dab513ae8c679511a848421d.tar.bz2
moa-id-spss-6b38531ef2a829e3dab513ae8c679511a848421d.zip
untested, but without dependency problems
Diffstat (limited to 'id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java')
-rw-r--r--id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
index bf4a55e46..1be3e3daa 100644
--- a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
+++ b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/SAML1AuthenticationServer.java
@@ -43,6 +43,11 @@ import org.xml.sax.SAXException;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandate;
import at.gv.e_government.reference.namespace.mandates._20040701_.Mandator;
+import at.gv.egiz.eaaf.core.api.IRequest;
+import at.gv.egiz.eaaf.core.api.idp.IAuthData;
+import at.gv.egiz.eaaf.core.api.storage.ITransactionStorage;
+import at.gv.egiz.eaaf.core.exceptions.EAAFException;
+import at.gv.egiz.eaaf.core.impl.utils.Random;
import at.gv.egovernment.moa.id.auth.AuthenticationServer;
import at.gv.egovernment.moa.id.auth.builder.AuthenticationDataAssertionBuilder;
import at.gv.egovernment.moa.id.auth.builder.BPKBuilder;
@@ -57,17 +62,12 @@ import at.gv.egovernment.moa.id.auth.parser.SAMLArtifactParser;
import at.gv.egovernment.moa.id.auth.validator.parep.ParepUtils;
import at.gv.egovernment.moa.id.commons.MOAIDAuthConstants;
import at.gv.egovernment.moa.id.commons.api.IOAAuthParameters;
-import at.gv.egovernment.moa.id.commons.api.IRequest;
import at.gv.egovernment.moa.id.commons.api.data.ExtendedSAMLAttribute;
import at.gv.egovernment.moa.id.commons.api.data.SAML1ConfigurationParameters;
import at.gv.egovernment.moa.id.commons.api.exceptions.ConfigurationException;
-import at.gv.egovernment.moa.id.commons.db.ex.MOADatabaseException;
-import at.gv.egovernment.moa.id.data.AuthenticationData;
-import at.gv.egovernment.moa.id.data.IAuthData;
+import at.gv.egovernment.moa.id.data.MOAAuthenticationData;
import at.gv.egovernment.moa.id.data.Pair;
import at.gv.egovernment.moa.id.protocols.pvp2x.PVPConstants;
-import at.gv.egovernment.moa.id.storage.ITransactionStorage;
-import at.gv.egovernment.moa.id.util.Random;
import at.gv.egovernment.moa.logging.Logger;
import at.gv.egovernment.moa.util.Base64Utils;
import at.gv.egovernment.moa.util.Constants;
@@ -86,7 +86,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
@Autowired private ITransactionStorage authenticationDataStore;
- /**
+ /**
* time out in milliseconds used by {@link cleanup} for authentication data
* store
*/
@@ -103,8 +103,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
}
Throwable error = null;
try {
- error = authenticationDataStore
- .get(samlArtifact, Throwable.class);
+ error = authenticationDataStore.get(samlArtifact, Throwable.class);
if (error == null) {
Logger.error("Assertion not found for SAML Artifact: " + samlArtifact);
@@ -114,7 +113,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
authenticationDataStore.remove(samlArtifact);
- } catch (MOADatabaseException e) {
+ } catch (EAAFException e) {
Logger.error("Assertion not found for SAML Artifact: " + samlArtifact);
throw new AuthenticationException("1206", new Object[] { samlArtifact });
}
@@ -189,7 +188,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
}
- } catch (MOADatabaseException e) {
+ } catch (EAAFException e) {
Logger.error("Assertion not found for SAML Artifact: " + samlArtifact);
throw new AuthenticationException("1206", new Object[] { samlArtifact });
}
@@ -201,10 +200,10 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
}
public String BuildErrorAssertion(Throwable error, IRequest protocolRequest)
- throws BuildException, MOADatabaseException {
+ throws EAAFException {
String samlArtifact = new SAMLArtifactBuilder().build(
- protocolRequest.getOAURL(), protocolRequest.getRequestID(),
+ protocolRequest.getSPEntityId(), protocolRequest.getPendingRequestId(),
null);
authenticationDataStore.put(samlArtifact, error, authDataTimeOut);
@@ -428,7 +427,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
//authData.setSamlAssertion(samlAssertion);
String samlArtifact = new SAMLArtifactBuilder().build(
- authData.getIssuer(), Random.nextRandom(),
+ authData.getAuthenticationIssuer(), Random.nextRandom(),
sourceID);
storeAuthenticationData(samlArtifact, samlAssertion);
@@ -443,7 +442,7 @@ public class SAML1AuthenticationServer extends AuthenticationServer {
}
- private String generateMandateDate(IOAAuthParameters oaParam, AuthenticationData authData
+ private String generateMandateDate(IOAAuthParameters oaParam, MOAAuthenticationData authData
) throws AuthenticationException, BuildException,
ParseException, ConfigurationException, ServiceException,
ValidateException {