summaryrefslogtreecommitdiff
path: root/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java
diff options
context:
space:
mode:
authorThomas <thomas.lenz@egiz.gv.at>2020-02-02 19:32:21 +0100
committerThomas <thomas.lenz@egiz.gv.at>2020-02-02 19:32:21 +0100
commit41ea2fdf782cd64d7d29f73c2e83f9c255810818 (patch)
tree9710ca3937ae82391c6a2a0e5176923e0a49a5af /eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java
parentd41afe91ee59daf6b5f5037cecac52900fe2ccb2 (diff)
downloadEAAF-Components-41ea2fdf782cd64d7d29f73c2e83f9c255810818.tar.gz
EAAF-Components-41ea2fdf782cd64d7d29f73c2e83f9c255810818.tar.bz2
EAAF-Components-41ea2fdf782cd64d7d29f73c2e83f9c255810818.zip
some more OpenSAML3 refactoring stuff
Diffstat (limited to 'eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java')
-rw-r--r--eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java30
1 files changed, 22 insertions, 8 deletions
diff --git a/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java
index dc60019a..d23affba 100644
--- a/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java
+++ b/eaaf_modules/eaaf_module_pvp2_core/src/main/java/at/gv/egiz/eaaf/modules/pvp2/impl/opensaml/EaafHttpPostDecoder.java
@@ -7,10 +7,13 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;
+import org.opensaml.core.xml.XMLObject;
import org.opensaml.messaging.decoder.MessageDecodingException;
import org.opensaml.saml.saml2.binding.decoding.impl.HTTPPostDecoder;
import com.google.common.base.Strings;
+
+import at.gv.egiz.eaaf.modules.pvp2.impl.utils.Saml2Utils;
import lombok.extern.slf4j.Slf4j;
import net.shibboleth.utilities.java.support.codec.Base64Support;
@@ -34,8 +37,6 @@ public class EaafHttpPostDecoder extends HTTPPostDecoder {
encodedMessage = getLastParameterFromRequest(request, "SAMLResponse");
}
-
-
if (Strings.isNullOrEmpty(encodedMessage)) {
log.info("Request did not contain either a SAMLRequest or "
+ "SAMLResponse paramter. Invalid request for SAML 2 HTTP POST binding.");
@@ -54,14 +55,27 @@ public class EaafHttpPostDecoder extends HTTPPostDecoder {
}
/**
- * Always read the last parameter with this name from request to get a strict deterministic behavior.
- * <br><br>
- * <b><i>If more than one parameters with the same name exists,
- * this method always select the last parameter value.</i></b>
+ * EAAF specific unmarshaller perform XML schema validation before unmarshalling
+ * the SAML message.
+ *
+ */
+ @Override
+ protected XMLObject unmarshallMessage(final InputStream messageStream) throws MessageDecodingException {
+ return Saml2Utils.unmarshallMessage(messageStream);
+
+ }
+
+ /**
+ * Always read the last parameter with this name from request to get a strict
+ * deterministic behavior. <br>
+ * <br>
+ * <b><i>If more than one parameters with the same name exists, this method
+ * always select the last parameter value.</i></b>
*
- * @param request Incoming http request
+ * @param request Incoming http request
* @param paramName Name of the http parameter
- * @return the last parameter value with this name, or <code>null</code> if the parameter not exists
+ * @return the last parameter value with this name, or <code>null</code> if the
+ * parameter not exists
*/
@Nullable
private String getLastParameterFromRequest(@Nonnull HttpServletRequest request, @Nonnull String paramName) {