Question

I'm using the opensaml for our application that acts as Service Provider. So far, I have been manually creating the SP Metadata.
Is there example in Java to show how to programatically generate Service Provider Metadata ?

Was it helpful?

Solution

EntityDescriptor is the base of metadata, so thats what you start with, just add in the elements you whant by adding java object with usually the same name. Then you marshall the entitydescriptor and print xml.

I talk you through it on this blog page.

In my book, A Guide to OpenSAML, I have a lot of information and examples on OpenSAML.

EDIT New edition of the book is out, covering OpenSAML V3

OTHER TIPS

In addition to Stefan Rasmusson's blog you can checkout Vladimir Shafer's sample application showing use of spring-security-saml2 integration with spring application has pre-written code for automated metadata generation and has clean GUI for testing it also.

Link to spring-security-saml sample application Github Repo
Link to MetadataGenerator Class

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top