Prepare SAML Authentication request using OpenSaml3.1.1

Brent Putman putmanb at georgetown.edu
Fri Jun 12 15:50:45 EDT 2015



On 6/12/15 10:44 AM, Surinaidu Majji wrote:
> Thanks for the reply Brent,
> We are able to prepare AuthnRequest from AuhtenticationRequestBuilder
> as per your suggestion but not able to Marshel it properly.
>
>
> org.opensaml.core.xml.io.MarshallerFactory marfact = *new* 
> org.opensaml.core.xml.io.MarshallerFactory();
>


You can't just new() a MarshallerFactory like that.  It's empty.  You
need to directly or indirectly use the one that's been loaded with the
Marshaller impls via the bootstrap (v2) or init (v3) process.



> Marshaller mar = marfact.getMarshaller(authnRequest);
>
>
> In the above code, we are getting "mar" as null.
>
>



The answer is the similar as for the builders.  You obtain them from
the configured XMLObject providers.  I said earlier:


> ... We recommend you obtain XMLObject builders, marshallers and
> unmarshallers via the registered providers.  In v2, builder usage:
>
> https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUsrManJavaCreateFromScratch
>
> In v3, no wiki docs yet, but either use the global
> XMLObjectProviderRegistry via
> org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport, or the
> higher level methods on org.opensaml.core.xml.util.XMLObjectSupport.

The Marshaller wiki docs link for v2 is:
https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUsrManJavaWriteToXML

Same for Unmarshallers.

Most of the concepts (if not the specifics, package names, etc) from v2
are the same, so if you haven't read the entire v2 user's manual, you
really should:

https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManual
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20150612/ccf3c7f0/attachment.html>


More information about the dev mailing list