Sending SOAP messages in OpenSAML v3

Brent Putman putmanb at georgetown.edu
Wed May 4 17:06:42 EDT 2016



On 5/4/16 4:30 PM, Stefan Rasmusson wrote:
> There is something I'm not quite getting with the handlers. Can't I
> use the message handlers on the encoders?

Yes, you can use a MessageHandler on any MessageContext, client-side or
server-side.  In general, a MessageDecoder produces an inbound
MessageContext, which you can then run handlers on.  Then you have your
profile or flow logic. Then you construct and populate an outbound
MessageContext.  You can then run handlers on that, and then it is
encoded with a MessageDecoder.



> I have managed to use them on the SOAP pipeline, but how can I use
> the MessageLifetimeSecurityHandler with the HTTPRedirectDeflateDecoder?

That's a server-side decoder, implementing that SAML binding.  It's
going to produce a MessageContext, on which you can then run handlers. 
Exactly *how* you do that is up to your code.  For example, the
Shibboleth IdP is based on Spring Web Flow, and so we have flow actions
that handle running one or more handlers on message contexts, both
inbound and outbound.  That would be a good real world example to look at.

In the pipeline-based SOAP client, it's the client impl that
"orchestrates" the encoding, decoding and running the various handlers
and the appropriate time. On the server side, order of operations is
reversed.  It's going to be something else that orchestrates the
execution of the logical message pipeline.  If not SWF, then you might
do that in a servlet, or MVC controller or whatever.  It's going to be
determined by your server-side design and framework.

We don't use it in the IdP, but in package
org.opensaml.messaging.pipeline.servlet I did add an interface and
basic impl for a server-side pipeline, for holding the encoders,
decoders and handlers, specialized for the server-side
HttpServletRequest/-Response case..  Calling those would be up to you
however, since it can't know how the "business logic" in the middle is
going to work, and what the overall execution environment looks like. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160504/c93cd908/attachment.html>


More information about the dev mailing list