From 0adb60a5f345f8914b40b108608358c573b3dffb Mon Sep 17 00:00:00 2001 From: Florian Reimair Date: Thu, 6 Mar 2014 08:53:26 +0100 Subject: cleanup StorkProtocol base --- .../moa/id/protocols/stork2/STORKProtocol.java | 30 +++------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'id/server/idserverlib') 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 a361d5f67..496d1044b 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 @@ -9,12 +9,6 @@ import at.gv.egovernment.moa.logging.Logger; import eu.stork.peps.auth.commons.*; import eu.stork.peps.auth.engine.STORKSAMLEngine; import eu.stork.peps.exceptions.STORKSAMLEngineException; -import org.opensaml.common.binding.BasicSAMLMessageContext; -import org.opensaml.ws.transport.http.HTTPInTransport; -import org.opensaml.ws.transport.http.HTTPOutTransport; -import org.opensaml.ws.transport.http.HttpServletRequestAdapter; -import org.opensaml.ws.transport.http.HttpServletResponseAdapter; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.HashMap; @@ -36,16 +30,10 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { private static HashMap actions = new HashMap(); static { - actions.put(AUTHENTICATIONREQUEST, new AuthenticationRequest()); actions.put(ATTRIBUTE_COLLECTOR, new AttributeCollector()); - - instance = new STORKProtocol(); } - private static STORKProtocol instance = null; - - public String getName() { return NAME; } @@ -77,12 +65,6 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { if (AttributeCollector.class.getSimpleName().equals(action)) return STORK2Request; - HTTPInTransport profileReq = new HttpServletRequestAdapter(request); - HTTPOutTransport profileResp = new HttpServletResponseAdapter(response, request.isSecure()); - - BasicSAMLMessageContext samlMessageContext = new BasicSAMLMessageContext(); - samlMessageContext.setInboundMessageTransport(profileReq); - //extract STORK Response from HTTP Request byte[] decSamlToken; try { @@ -93,22 +75,21 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { } //Get SAMLEngine instance - STORKSAMLEngine authnEngine = STORKSAMLEngine.getInstance("incoming"); - STORKSAMLEngine attrEngine = STORKSAMLEngine.getInstance("incoming_attr"); + STORKSAMLEngine engine = STORKSAMLEngine.getInstance("VIDP"); STORKAuthnRequest authnRequest = null; STORKAttrQueryRequest attrRequest = null; // check if valid authn request is contained try { - authnRequest = authnEngine.validateSTORKAuthnRequest(decSamlToken); + authnRequest = engine.validateSTORKAuthnRequest(decSamlToken); } catch (STORKSAMLEngineException ex) { Logger.error("Unable to validate Stork AuthenticationRequest: " + ex.getMessage()); } catch(ClassCastException e) { // we do not have a authnRequest // check if a valid attr request is container try { - attrRequest = attrEngine.validateSTORKAttrQueryRequest(decSamlToken); + attrRequest = engine.validateSTORKAttrQueryRequest(decSamlToken); } catch (STORKSAMLEngineException ex) { Logger.error("Unable to validate Stork AuthenticationRequest: " + ex.getMessage()); } @@ -137,11 +118,6 @@ public class STORKProtocol implements IModulInfo, MOAIDAuthConstants { public boolean validate(HttpServletRequest request, HttpServletResponse response, IRequest pending) { return false; } - - public void checkPersonalAttributes() { - - - } } -- cgit v1.2.3