aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKAuthnReq.java32
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java4
2 files changed, 35 insertions, 1 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKAuthnReq.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKAuthnReq.java
index c79423ffc..9bf4ed0d1 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKAuthnReq.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKAuthnReq.java
@@ -1,8 +1,12 @@
package at.gv.egovernment.moa.id.protocols.stork2;
import at.gv.egovernment.moa.id.moduls.IRequest;
+import at.gv.egovernment.moa.id.protocols.pvp2x.binding.MOAURICompare;
+import at.gv.egovernment.moa.logging.Logger;
import eu.stork.peps.auth.commons.STORKAuthnRequest;
-
+import org.opensaml.common.binding.BasicSAMLMessageContext;
+import org.opensaml.saml2.binding.decoding.HTTPPostDecoder;
+import org.opensaml.ws.transport.http.HTTPInTransport;
/**
@@ -24,6 +28,32 @@ public class STORKAuthnReq implements IRequest {
return this.storkAuthnRequest;
}
+ public void createStorkReq(HTTPInTransport profileReq) {
+ Logger.debug("Generate stork request test...");
+ storkAuthnRequest = new STORKAuthnRequest();
+
+ BasicSAMLMessageContext samlMessageContext = new BasicSAMLMessageContext();
+ samlMessageContext.setInboundMessageTransport(profileReq);
+
+ HTTPPostDecoder postDecoder = new HTTPPostDecoder();
+ postDecoder.setURIComparator(new MOAURICompare()); // TODO Abstract to use general comparator
+
+ try {
+ Logger.debug("Attempting to decode request...");
+ postDecoder.decode(samlMessageContext);
+ } catch (Exception e) {
+ Logger.error("Error decoding STORKAuthnRequest", e);
+ }
+
+
+ storkAuthnRequest = (STORKAuthnRequest)samlMessageContext.getInboundSAMLMessage();
+ samlMessageContext.getinbound
+ storkAuthnRequest.set
+
+ }
+
+
+
public String getOAURL() {
return "https://sp:8889/SP"; //
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
index 15096083e..e99079191 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/protocols/stork2/STORKProtocol.java
@@ -108,6 +108,10 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants {
Logger.debug("STORK2 ISSUER: " + ST2Req.getIssuer().toString());
+ STORKAuthnReq storkAuthnReq = new STORKAuthnReq();
+
+
+
return STORK2Request;
}