Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Using XMLObject to create saml:AttributeValues

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Using XMLObject to create saml:AttributeValues


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: [OpenSAML] Using XMLObject to create saml:AttributeValues
  • Date: Thu, 11 Sep 2008 13:58:43 -0400

There's an example of that here in the User's Guide. 

https://spaces.internet2.edu/display/OpenSAML/OSTwoUsrManJavaAnyTypes#OSTwoUsrManJavaAnyTypes-AttributeValues

Some of the other stuff on that page is a little misleading and/or conceptually incorrect, but that example at the bottom is what you want to do.

--Brent


Mazza, Glen R. wrote:

Hello, I’m a newbie with OpenSAML (using version 2) and I’m trying to create a SAML 2.0 token for a SOAP header using this library.  I’m using the OpenSAML API to manually to create the SAML token.

 

Everything seems to be going fine in creating saml:Subjects, saml:AuthnStatements, etc., but I’m having trouble creating an saml:AttributeValue, within a saml:Attribute.  This is my goal:

 

<saml:Assertion>

….

<saml:AttributeStatement>

      <saml:Attribute Name="Level" NameFormat="http://www.example.org/System/Security">

         <saml:AttributeValue>Advanced</saml:AttributeValue>

      </saml:Attribute>

</saml:AttributeStatement>

….

</saml:Assertion>

 

Saml:AttributeStatement and saml:attribute can be created easily using the OpenSAML API, but saml:AttributeValue is of type “org.opensaml.xml.XMLObject”, it is attached to the saml:Attribute via this type of function call:

 

attributeObj.getAttributeValues().add(xmlObj);

 

Problem is, I don’t know how to convert “<saml:AttributeValue>Advanced</saml:AttributeValue>” into an xmlObj so I can attach it to the attribute.  Can anyone point me to sample code that shows how to do this?

 

Thanks,

Glen

 




Archive powered by MHonArc 2.6.16.

Top of Page