Skip to Content.
Sympa Menu

mace-opensaml-users - Problem building SAMLAssertion

Subject: OpenSAML user discussion

List archive

Problem building SAMLAssertion


Chronological Thread 
  • From: Jean-Noel Colin <>
  • To: Scott Cantor <>
  • Cc:
  • Subject: Problem building SAMLAssertion
  • Date: Thu, 06 Oct 2005 20:21:02 +0200

Scott

I'm sorry to disturb you again, but I'm trying to build a SAMLAssertion from a String, and I can't get it to work.
The String below (except the <?xml version="1.0" encoding="UTF-8"?>) part is simply the output of the SAMLAssertion.toString() method. This is received by a WebService consumer, and I'd need to build a SAMLAssertion object from that String.

I tried building from an Element:

InputSource is = new InputSource(new
StringReader(token));
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
SAMLAssertion assertion = new
SAMLAssertion(doc.getDocumentElement());

But I get an exception:

Exception in thread "main" java.lang.IllegalArgumentException: local part cannot be "null" when creating a QName
at javax.xml.namespace.QName.<init>(QName.java:164)
at javax.xml.namespace.QName.<init>(QName.java:113)
at org.opensaml.SAMLStatement.getInstance(Unknown Source)
at org.opensaml.SAMLAssertion.fromDOM(Unknown Source)
at org.opensaml.SAMLAssertion.<init>(Unknown Source)
at net.iclass.sts.TestWS.main(TestWS.java:55)

Would you have any idea why this fails? Would you suggest another way?

Best regards

Jean-Noel Colin

<?xml version="1.0" encoding="UTF-8"?><Assertion xmlns="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; AssertionID="_9d23ba8aef6f24ad325bdb9022751cc5" IssueInstant="2005-10-06T18:00:41.022Z" Issuer="urn:iclass:services:naivests" MajorVersion="1" MinorVersion="1"><Conditions NotBefore="2005-10-06T18:00:41.022Z" NotOnOrAfter="2005-10-06T19:00:41.022Z"></Conditions><AuthenticationStatement AuthenticationInstant="2005-10-06T18:00:41.022Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password"><Subject><NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="ItalDATA MLE">Jean-Noel</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</ConfirmationMethod></SubjectConfirmation></Subject></AuthenticationStatement><AttributeStatement><Subject><NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" NameQualifier="ItalDATA MLE">Jean-Noel</NameIdentifier><SubjectConfirmation><ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</ConfirmationMethod></SubjectConfirmation></Subject><Attribute AttributeName="roles" AttributeNamespace="urn:iclass:names"><AttributeValue>Teacher</AttributeValue><AttributeValue>Administrator</AttributeValue></Attribute></AttributeStatement><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#";>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#";></ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1";></ds:SignatureMethod>
<ds:Reference URI="#_9d23ba8aef6f24ad325bdb9022751cc5">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature";></ds:Transform>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#";><ec:InclusiveNamespaces xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"; PrefixList="code ds kind rw saml samlp typens #default xsd xsi"></ec:InclusiveNamespaces></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1";></ds:DigestMethod>
<ds:DigestValue>4/WP7GgeG2FP6DAIhGoIuMkFGCU=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
bl1hhME9CrCS27ssA+Y+VpwaqamSzW8b2zsG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