Skip to Content.
Sympa Menu

mace-opensaml-users - Re: Extending the opensaml

Subject: OpenSAML user discussion

List archive

Re: Extending the opensaml


Chronological Thread 
  • From: Brent Putman <>
  • To:
  • Subject: Re: Extending the opensaml
  • Date: Wed, 17 Oct 2007 18:58:03 -0400

Håkon,
Glad that the problem turned out to be a typo and that you got it working.

I just wanted to note for the record that both approaches to registering
new object providers are correct. It can be done programatically, as
Manuela indicated, or it can be done declaratively, as Håkon did in an
xmltooling configuration file. However, you don't need to do both - one
or the other is sufficient. If you are using our DefaultBootstrap
process to init the library, probably the more typical way would be to
use the declarative, config file method.

Also, it isn't necessary (and by standard Java conventions probably
isn't advisable) to put extension objects in the org.opensaml package
namespace, nor is it necessary to declare new object providers in one of
the existing object providers config files (e.g.
saml2-protocol-config.xml), which if you were using an eventual binary
distribution of OpenSAML would mean cracking open the library jar file
and editing the files and repackaging. Instead you can and should use
config files (external to the OpenSAML jar) which contain only the
desired extension objects, validator suites and other config info, and
then load those for example by either overriding DefaultBootstap to
additionally load that config file, or by using the XMLConfigurator
load() methods directly.

Thanks,
Brent


Håkon Tuvin Sagehaug wrote:
> Håkon Tuvin Sagehaug skrev:
>> Manuela Stanica skrev:
>>> Hi,
>>>
>>> have you registered the object providers for your new saml2 objects
>>> and their corresponding builder, marhaller and unmarshaller in the
>>> org.opensaml.Configuration class?
>>> In your case it could look similar to:
>>>
>>> Configuration.registerObjectProvider(XACMLAuthzDecisionQuery.DEFAULT_ELEMENT_NAME,
>>> new XACMLAuthzDecisionQueryBuilder(), new
>>> XACMLAuthzDecisionQueryMarshaller(), new
>>> XACMLAuthzDecisionQueryUnmarshaller(), null);
>>>
>>> (and same for XACMLAuthzDecisionQueryType).
>>>
>>> I've also needed to build extensions to the saml2 library, and it
>>> all worked when just adding these lines before code that uses the
>>> new objects.
>>>
>>> Hope this helps (?)
>>>
>>> Cheers,
>>> Manuela
>>>
>>>
>>>
>>> Håkon Tuvin Sagehaug schrieb:
>>>> Hi
>>>>
>>>> I want to extend the saml 2 protocol, but have some problems
>>>> getting it to work. I have an interface, a class that implements
>>>> the interface, builder,marshaller and unmarshaller. In
>>>> my saml2-protocol-config.xml I have this information(both in the
>>>> opensaml-src and opensaml-xmltooling):
>>>>
>>>> <ObjectProvider qualifiedName="saml2p:XACMLAuthzDecisionQuery">
>>>> <BuilderClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryBuilder"
>>>> />
>>>> <MarshallingClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryMarshaller"
>>>> />
>>>> <UnmarshallingClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryUnmarshaller"
>>>> />
>>>> </ObjectProvider>
>>>>
>>>> <ObjectProvider
>>>> qualifiedName="saml2p:XACMLAuthzDecisionQueryType">
>>>> <BuilderClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryBuilder"
>>>> />
>>>> <MarshallingClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryMarshaller"
>>>> />
>>>> <UnmarshallingClass
>>>> className="org.opensaml.saml2.core.impl.XACMLAuthzDecisionQueryUnmarshaller"
>>>> />
>>>> </ObjectProvider>
>>>> and here is the error stack I'm getting
>>>>
>>>> Exception in thread "main"
>>>> java.lang.NullPointerException
>>>> at
>>>> java.util.concurrent.ConcurrentHashMap.remove(ConcurrentHashMap.java:919)
>>>>
>>>> at
>>>> org.opensaml.xml.XMLObjectBuilderFactory.deregisterBuilder(XMLObjectBuilderFactory.java:115)
>>>>
>>>> at
>>>> org.opensaml.xml.Configuration.deregisterObjectProvider(Configuration.java:123)
>>>>
>>>> at
>>>> org.opensaml.xml.XMLConfigurator.initializeObjectProviders(XMLConfigurator.java:264)
>>>>
>>>> at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:179)
>>>> at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:161)
>>>> at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:129)
>>>> at
>>>> org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:127)
>>>>
>>>> at
>>>> org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:71)
>>>> at
>>>> opensaml20.test.TestCreateSAML20Assertion.main(TestCreateSAML20Assertion.java:1036)
>>>>
>>>>
>>>> It looks to me that the builder can not be resolved or something.
>>>> Can anyone help me????
>>>>
>>>
>>>
>> Hi
>>
>> I got a NullPointerException when I did this(what mauela suggested),
>> I think the problem is that the builders can't be created, but I
>> can't figure it out. Here is how it look like
>> public class XACMLAuthzDecisionQueryBuilder extends
>> AbstractSAMLObjectBuilder<XACMLAuthzDecisionQuery>{...} the marshaller
>> public class XACMLAuthzDecisionQueryMarshaller extends
>> AbstractSAMLObjectMarshaller{...} and the unmarshaller
>> public class XACMLAuthzDecisionQueryUnMarshaller extends
>> AbstractSAMLObjectUnmarshaller{...}
>>
>> Does anyone have a tip for me??
>>
> Hi
>
> Forget this thread, I had a typo in my configuration file
>
> cheers
>



Archive powered by MHonArc 2.6.16.

Top of Page