Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-584

SAMLParser is failing to parse <SubjectConfirmation> tag if there are multiple subelements defined in SubjectConfirmation tag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • PLINK_2.7.0.CR1
    • PLINK_2.6.0.Final
    • SAML

      This error can be reproduced if the Subelements of SubjectConfirmation are as following

      <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:sender-vouches">
      <NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" SPNameQualifier="samplesp.com">CN=Alice, OU=Rockford, O=AVT, C=IN</NameID>
      <SubjectConfirmationData Recipient="https://sample.sp.com/consumer"/>
      </SubjectConfirmation>

      If the <SubjectConfirmation> in the assertion contains both <NameID> and <SubjectConfirmationData> tags,SAMLSubjectParser is failing to parse and throwing the following error.

      java.lang.ClassCastException: com.ctc.wstx.evt.CompactStartElement cannot be cast to javax.xml.stream.events.EndElement
      at org.picketlink.identity.federation.core.parsers.saml.SAMLSubjectParser.parse(SAMLSubjectParser.java:128) [picketlink-federation-2.6.1.Final.jar:]
      at org.picketlink.identity.federation.core.parsers.saml.SAMLAssertionParser.parse(SAMLAssertionParser.java:132) [picketlink-federation-2.6.1.Final.jar:]
      at org.picketlink.identity.federation.core.parsers.saml.SAMLResponseParser.parse(SAMLResponseParser.java:74) [picketlink-federation-2.6.1.Final.jar:]
      at org.picketlink.identity.federation.core.parsers.saml.SAMLParser.parse(SAMLParser.java:83) [picketlink-federation-2.6.1.Final.jar:]
      at org.picketlink.common.parsers.AbstractParser.parse(AbstractParser.java:108) [picketlink-common-2.6.1.Final.jar:

            psilva@redhat.com Pedro Igor Craveiro
            kirankambam_jira kiran k (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: