Skip to Content.
Sympa Menu

mace-opensaml-users - missing namespace attribute

Subject: OpenSAML user discussion

List archive

missing namespace attribute


Chronological Thread 
  • From: "Tom Scavo" <>
  • To: OpenSAML <>
  • Subject: missing namespace attribute
  • Date: Thu, 26 Oct 2006 10:39:42 -0400
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=n3wgAfs5ETEO2tx8UofGpwj5O9XsHBVjljLI63FLS9xSNmbqf9j5D1nXk+X8XrdrUHhxBvczwZDvx4kXkAZn0anD+gL3rnUVKJ+tqoHw7RPtxgMpnmtYU//MSPDzeNqNkqRBniqlwFVgEjmcwQUGBfTET38jAe76BYrK1M2qBH8=

I'm implementing a new SAML V1.1 statement type, a straightforward
extension of saml:SubjectStatementAbstractType:

<complexType name="SubjectStatementType">
<complexContent>
<extension base="saml:SubjectStatementAbstractType"/>
</complexContent>
</complexType>

For example:

<saml:SubjectStatement
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:samlsap="someURI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:type="samlsap:SubjectStatementType">
<saml:Subject>...</saml:Subject>
</saml:SubjectStatement>

The implementation extends SAMLSubjectStatement from OpenSAML V1.1.
So far I've been unable to obtain the required root element using the
method:

protected Element buildRoot(Document doc, boolean xmlns) {
Element s = doc.createElementNS(XML.SAML_NS, "SubjectStatement");
if (xmlns) {
s.setAttributeNS(XML.XMLNS_NS, "xmlns", XML.SAML_NS);
s.setAttributeNS(XML.XMLNS_NS, "xmlns:xsd", XML.XSD_NS);
s.setAttributeNS(XML.XMLNS_NS, "xmlns:xsi", XML.XSI_NS);
}
s.setAttributeNS(XML.XMLNS_NS, "xmlns:samlsap", SAMLSAP_NS);
s.setAttributeNS(XML.XSI_NS, "xsi:type", XSI_TYPE);
return s;
}

This produces

<SubjectStatement
xsi:type="samlsap:SubjectStatementType">
<Subject>
<NameIdentifier
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName">
uid=By-Tor,ou=tobes,dc=hades,dc=com
</NameIdentifier>
</Subject>
</SubjectStatement>

which is missing a namespace attribute (xmlns:samlsap). If someone
could tell me what I'm doing wrong, I'd really appreciate it.

Thanks,
Tom



Archive powered by MHonArc 2.6.16.

Top of Page