OpenSAML Velocity templates for POST etc. responses

Cantor, Scott cantor.2 at osu.edu
Thu Feb 14 00:37:08 EST 2013


On 2/14/13 12:17 AM, "Michael A Grady" <mgrady at unicon.net> wrote:
>
>Since one is going to have to copy 4 or 5 files into either the
>'WEB-INF/classes' or 'WEB-INF/classes/templates' directory anyways, I
>don't know if including a stubbed file include in the distribution
>templates really makes anything easier. You don't want to put the exact
>same GA javascript in each of the 4 templates because it's nice to have a
>different string for the "Action" parameter of the event being tracked in
>each of those templates (e.g. saml2 post, saml1 post).

I guess I didn't pick up on that being important, or I assumed that the
javascript would pick up something like that somehow without it requiring
separate files. I was assuming it would be one file added.

> So you'd need to have each template include a different stubbed file,
>and one would still need 4/5 files. Unless you wanted to add a Velocity
>"set" in also. So you'd need to add something like
>
><head>
>#set( $samlResponseType = "saml2-post-binding" )
>#parse GAjavascript.txt
></head>
>
>in each template, varying the samlResponseType string in each.

There might be something we could inject into the context that could be
picked up without having to do it manually in the templates. I'd have to
see what the code's doing when it creates the context and what it has
access to.

> (Unless Velocity can access the filename of the file containing it, but
>I haven't found anything about accessing environment variables.)

I would have thought it could do that, but if not that's probably
something we could inject.

But as I said originally, no, this is not really a big deal or all that
helpful vs. just copying a few files. The real problem for me is that
they're in the warfile at all, but that's too large a change until 3.0.

-- Scott




More information about the dev mailing list