The Shibboleth IdP V4 software has reached its End of Life and is no longer supported. This documentation is available for historical purposes only. See the IDP5 wiki space for current documentation on the supported version.

Moving to Suppliers for accessing HttpServlet Objects

Prior to V5.0 the HttpServletRequest and HttpServletResponse objects for the current request were made available via two PredefinedBeans called shibboleth.HttpServletRequest and shibboleth.HttpServletResponse. In V4.3 these have been deprecated and using them will cause a warning.

From V4.3 these objects are available via Supplier beans called shibboleth.HttpServletRequestSupplier and shibboleth.HttpServletResponseSupplier.

In order to prepare for V5 all use of the old beans must be replaced by use of the new beans. This is relatively formulaic.

Spring Wiring

All objects which took a p:httpServletRequest property now take a p:httpServletRequestSupplier property hence

<bean id="MyCondition" class="org.opensaml.profile.logic.IPRangePredicate" p:httpServletRequest-ref="shibboleth.HttpServletRequest" p:ranges="#{ '192.168.1.0/24', '192.168.2.0/28' }" />

becomes

<bean id="MyCondition" class="org.opensaml.profile.logic.IPRangePredicate" p:httpServletRequestSupplier-ref="shibboleth.HttpServletRequestSupplier" p:ranges="#{ '192.168.1.0/24', '192.168.2.0/28' }" />

Scripting, Velocity

If the script previously passed shibboleth.HttpServletRequest as the custom parameter it should now have shibboleth.HttpServletRequestSupplier passed instead.

Inside the script the change consists of adding a call to get() in between the original reference to the bean and the servlet method called.

Hence the (contrived) example

<bean id="exampleCondition" parent="shibboleth.Conditions.Scripted" factory-method="inlineScript" p:customObject-ref="shibboleth.HttpServletRequest"> <constructor-arg> <value> <![CDATA[ // Default return value. var result= false; // Make HTTPServletRequest object known as "request". var request = custom; // Check the client's IP address. if (request.remoteAddr.startsWith("192.168.42.")) { activate = true; } result; ]]> </value> </constructor-arg> </bean>

becomes

Â