Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] How do I send an AuthnRequest?

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] How do I send an AuthnRequest?


Chronological Thread 
  • From: Nick Newman <>
  • To:
  • Subject: Re: [OpenSAML] How do I send an AuthnRequest?
  • Date: Thu, 19 Aug 2010 16:48:48 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=QyCs+N2jZr3j6H8/8nWCAIXlfcnMDVK80SEtkTS2Et5tsPvMNw3eyu7rtsh+KHyjVp DaTQpn228l8QNPIj9xFPZcHJI6j1XGLwOw/snPEYwm0byrPWPhbc7mZgYgLO1RO8y/VW d8QsxhAFIU3lJICHPmYlVkKVsEcTvtEr1CCW0=

Brent,

Thank you, it does help.

I had seen in my searchings that OpenSAML initialized Velocity during its initialization, and had assumed that I somehow had to get hold of that same instance.  Creating a new engine is easy - and it works!

This was my first look at OpenSAML and I thought it worked very nicely, despite my relative ignorance.  A very useful package.

Thanks again,
Nick

On Thu, Aug 19, 2010 at 4:40 PM, Brent Putman <> wrote:


On 8/19/10 5:32 PM, Nick Newman wrote:
> Hi,
>
> Hopefully an easy question...
>
> I am trying to use OpenSAML to send an AuthnRequest, and it seems that
> the HttpPostEncoder class is intended to be used for that purpose.


Yes, if by "send" you mean usage of the HTTP-POST front-channel binding
of SAML 2. That's what that particular encoder implements.  If you are
unsure what that means, take a look at the SAML 2 Bindings spec document.




 But
> to construct an instance I need to supply a VelocityEngine and the
> template ID.
>
> So how do I get a reference to the VelocityEngine, and how do I find the
> template ID to use?
>


Yes, that's correct.  As far as the VelocityEngine goes, you just
construct a new instance, with options and properties as you like.  If
you haven't used that before, probably best to take a look at the
Velocity docs, it's not terribly complex.

The template ID is relative to the type of Velocity resource loader(s)
that you specify for the VelocityEngine.  We supply some templates for
the encoders in the java-opensaml2 jar, under /templates.  You can get
at those directly by using the Velocity ClasspathResourceLoader.  The
default template intended for use with the HTTP-POST encoder is
"/templates/saml2-post-binding.vm".  You could also copy that,
customize, and reference it from the filesystem or elsewhere, by using a
different resource loader impl.

If you know Spring, take a look at the context file we use for the Shib
IdP, it has an example of how to wire up those components:

http://svn.middleware.georgetown.edu/view/java-idp/branches/REL_2/src/installer/resources/conf-tmpl/internal.xml?revision=2929

Specifically the beans with id's:

shibboleth.VelocityEngine
shibboleth.SAML2HttpPostEncoder


Hope that helps,
Brent





Archive powered by MHonArc 2.6.16.

Top of Page