diff options
author | harald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-09-02 16:03:53 +0000 |
---|---|---|
committer | harald.bratko <harald.bratko@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-09-02 16:03:53 +0000 |
commit | 62f820c249a093ad4ae5ff82392be88563b94fca (patch) | |
tree | bea85b09fdbf458aba86d31959150c9a368416b3 /id.server/src/at/gv/egovernment/moa | |
parent | 235241ec5f18ad26c013b091887ce5f651462553 (diff) | |
download | moa-id-spss-62f820c249a093ad4ae5ff82392be88563b94fca.tar.gz moa-id-spss-62f820c249a093ad4ae5ff82392be88563b94fca.tar.bz2 moa-id-spss-62f820c249a093ad4ae5ff82392be88563b94fca.zip |
*** empty log message ***
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@491 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa')
-rw-r--r-- | id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java b/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java index 24029120e..b19b40830 100644 --- a/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java +++ b/id.server/src/at/gv/egovernment/moa/id/auth/validator/IdentityLinkValidator.java @@ -31,7 +31,7 @@ public class IdentityLinkValidator implements Constants { /** Xpath prefix for reaching ECDSA Namespaces */ private static final String ECDSA = ECDSA_PREFIX + ":"; /** Xpath expression to the root element */ - private static final String ROOT = "/" + SAML + "Assertion/"; + private static final String ROOT = ""; /** Xpath expression to the SAML:SubjectConfirmationData element */ private static final String SAML_SUBJECT_CONFIRMATION_DATA_XPATH = ROOT @@ -92,8 +92,9 @@ public class IdentityLinkValidator implements Constants { */ public void validate(IdentityLink identityLink) throws ValidateException { + Element samlAssertion = identityLink.getSamlAssertion(); //Search the SAML:ASSERTION Object (A2.054) - if (identityLink.getSamlAssertion() == null) + if (samlAssertion == null) throw new ValidateException("validator.00", null); // Check how many saml:Assertion/saml:AttributeStatement/ @@ -101,7 +102,7 @@ public class IdentityLinkValidator implements Constants { // saml:SubjectConfirmationData/pr:Person of type // PhysicalPersonType exist (A2.056) NodeList nl = - XPathUtils.selectNodeList(identityLink.getSamlAssertion(), PERSON_XPATH); + XPathUtils.selectNodeList(samlAssertion, PERSON_XPATH); // If we have just one Person-Element we don't need to check the attributes int counterPhysicalPersonType = 0; if (nl.getLength() > 1) @@ -121,7 +122,7 @@ public class IdentityLinkValidator implements Constants { throw new ValidateException("validator.01", null); //Check the SAML:ATTRIBUTES - nl = XPathUtils.selectNodeList(identityLink.getSamlAssertion(), ATTRIBUTE_XPATH); + nl = XPathUtils.selectNodeList(samlAssertion, ATTRIBUTE_XPATH); for (int i = 0; i < nl.getLength(); i++) { String attributeName = XPathUtils.getAttributeValue( @@ -154,7 +155,7 @@ public class IdentityLinkValidator implements Constants { } //Check if dsig:Signature exists - Element dsigSignature = (Element) XPathUtils.selectSingleNode(identityLink.getSamlAssertion(),ROOT + DSIG + "Signature"); + Element dsigSignature = (Element) XPathUtils.selectSingleNode(samlAssertion,ROOT + DSIG + "Signature"); if (dsigSignature==null) throw new ValidateException("validator.05", null); } |