OpenSAML Velocity templates for POST etc. responses
Michael A Grady
mgrady at unicon.net
Thu Jan 3 14:50:41 EST 2013
Carnegie Mellon came up with the approach of using Google Analytics to track stats on the use of their IdP. The basic approach being to embed the Google Analytics tracking code into the Velocity templates used for POSTing back the responses. And I've been considering how one could package that into the OpenSAML distribution as an optional thing that an institution could choose to use.
Now I know that one could create one additional JAR file that just has those four (4) modified Velocity templates in them, each with a slightly different name than the originals, and then "wire in their use" by changing the appropriate config in the "internal.xml" file. And all the tracking code would be "non institutional specific" (unless someone wanted to change exactly what was tracked) *except* for the Google Analytics (GA) accountId. So the question is, how could one *not need* to hard-code that GA accountId into the template? I can think of two approaches that minimize changes to how this works now, and am wondering from any of you who know a bunch more about Spring, Velocity, etc. than me if one or the other these approaches would work:
- add the GA accountId as another constructor arg in "internal.xml" (after the templateId), and pick that up in the encoder and put it into the Velocity context, where the template can get it from. This seems easiest if it works, because you'd need to be modifying the "internal.xml" file anyways to specify the templateId to use.
- use the #include Velocity script element to read in a file that has the one line that specifies GA accountId. But I'm not sure if that directive will work in the context of the JAR file packaging.
Or is there some other better approach? A way that one could distribute that one new JAR file, with the four modified Velocity templates, and have the GA accountId externally specified/dynamically picked up?
--
Michael A. Grady
Senior IAM Consultant, Unicon, Inc.
More information about the dev
mailing list