OpenSAML 2.0 and x500 Attribute
Campbell, Shawn
scampbell at malone.edu
Mon Nov 18 14:40:02 EST 2013
I am trying to create a AttributeStatement containing an Attribute from an LDAP server source using the OpenSAML 2.0 libraries. Below is an example of what I am trying to create:
<saml:AttributeStatement>
<saml:Attribute
xmlns:x500="urn:oasis:names:tc:SAML:2.0:profiles:
attribute:X500" x500:Encoding="LDAP"
NameFormat="urn:oasis:names:tc:SAML:2.0:
attrname-format:uri"
Name="urn:oid:1.3.6.1.4.1.1466.115.121.1.26"
FriendlyName="mail">
<saml:AttributeValue
xsi:type="xs:string">
johndoe at gmail.com
</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
Below is my current source code for producing the AttributeStatement, Attribute, and AttributeValue.
// AttributeValue
XMLObjectBuilder t_AttributeValueBuilder = (XMLObjectBuilder)t_XMLObjectBuilderFactory.getBuilder(XSString.TYPE_NAME);
XSString t_AttributeValue = (XSString)t_AttributeValueBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
t_AttributeValue.setValue("bob at malone.edu");
// Attribute
AttributeBuilder t_AttributeBuilder = (AttributeBuilder)t_XMLObjectBuilderFactory.getBuilder(Attribute.DEFAULT_ELEMENT_NAME);
Attribute t_Attribute = t_AttributeBuilder.buildObject();
t_Attribute.setFriendlyName("mail");
t_Attribute.setName("urn:oid:1.3.6.1.4.1.1466.115.121.1.26");
t_Attribute.setNameFormat("urn:oasis:names:tc:SAML:2.0:attrname-format:uri");
t_Attribute.getAttributeValues().add(t_AttributeValue);
AttributeStatementBuilder t_AttributeStatementBuilder = AttributeStatementBuilder)t_XMLObjectBuilderFactory.getBuilder(AttributeStatement.DEFAULT_ELEMENT_NAME);
AttributeStatement t_AttributeStatement = t_AttributeStatementBuilder.buildObject();
t_AttributeStatement.getAttributes().add(t_Attribute);
t_Assertion.getAttributeStatements().add(t_AttributeStatement);
I am not sure how to add the following XML attributes to the Attribute element:
xmlns:x500="urn:oasis:names:tc:SAML:2.0:profiles:attribute:X500"
x500:Encoding="LDAP"
Does anyone know how to handle this in the OpenSAML 2.0 library?
Any assistance you can offer would be greatly appreciated.
Thank you.
Shawn Campbell
Systems Analyst
Information Technology Offices
Phone: 330.471.8501
Fax: 330.471.8302
E-mail: scampbell at malone.edu
[cid:image001.png at 01CEE46C.10A542F0]
Malone University
2600 Cleveland Avenue NW
Canton, Ohio 44709
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://shibboleth.net/pipermail/users/attachments/20131118/5a1cffd2/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 7927 bytes
Desc: image001.png
Url : http://shibboleth.net/pipermail/users/attachments/20131118/5a1cffd2/attachment.png
More information about the users
mailing list