aboutsummaryrefslogtreecommitdiff
path: root/id/server/modules/moa-id-modules-saml1
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/modules/moa-id-modules-saml1')
-rw-r--r--id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java
index f00358d02..893799b5d 100644
--- a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java
+++ b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java
@@ -66,6 +66,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
@@ -124,7 +125,8 @@ public class GetAuthenticationDataService extends AbstractController implements
private static final String CONTEXT_SOAP_STATUSCODE = "statusCode";
private static final String CONTEXT_SOAP_ASSERTION = "assertion";
- @RequestMapping(value = "/services/GetAuthenticationData", method = {RequestMethod.POST})
+ @RequestMapping(value = {"/services/GetAuthenticationData", "/services"},
+ method = {RequestMethod.POST})
public void getAuthenticationData(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
InputStream is = null;
@@ -225,13 +227,23 @@ public class GetAuthenticationDataService extends AbstractController implements
}
}
- //get first child from body --> should be the SAML1 Request element
- Element saml1Req;
- if (saml1ReqList.item(0).getFirstChild() instanceof Element)
- saml1Req = (Element) saml1ReqList.item(0).getFirstChild();
-
- else {
- throw new SAXException("First child of 'soap-env:Body' element has a wrong type.");
+ //get the first child from body which is of type Element (SAML1 Request element)
+ Element saml1Req = null;
+
+ Node reqObj = saml1ReqList.item(0).getFirstChild();
+ while (reqObj != null) {
+ if (reqObj instanceof Element) {
+ saml1Req = (Element) reqObj;
+ break;
+
+ } else {
+ reqObj = reqObj.getNextSibling();
+
+ }
+ }
+
+ if (saml1Req == null) {
+ throw new SAXException("Every child of 'soap-env:Body' element has a wrong type.");
}