Prepare SAML Authentication request using OpenSaml3.1.1

Brent Putman putmanb at georgetown.edu
Thu Jun 11 13:48:35 EDT 2015



On 6/11/15 1:23 AM, Surinaidu Majji wrote:
>
> A) base64 encoding/decoding packages in OpenSAML 3.1.1 (as highlighted
> below in red)
> B) XML helpers to convert DOM to Strings (as highlighted below in red)
>
> authDOM = marshaller.marshall(authnRequest); // converting to a DOM
> StringWriter requestWriter = new StringWriter();
> XMLHelper.writeNode(authDOM, requestWriter);

See java-support,
net.shibboleth.utilities.java.support.xml.SerializeSupport.  One of the
nodeToString(...) or writeNode(...) methods.




>
> encodedRequestMessage
> =Base64.encodeBytes(requestMessage.getBytes(),Base64.DONT_BREAK_LINES);
>
>


Again java-support,
net.shibboleth.utilities.java.support.codec.Base64Support.


Although: I don't necessarily want to open a can of worms, but if what
you're actually doing is trying to do is serialize and encode the data
in order to implement SAML binding(s), we have higher level components
in both v2 and v3 that do all that for you.  In v3 for SAML 2, look at
the MessageEncoder impls in the saml-impl module, package
org.opensaml.saml.saml2.binding.encoding.impl.  For usage examples, take
a look at the unit tests for those.  It's not difficult.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20150611/1f7eaca5/attachment.html>


More information about the dev mailing list