Attribute release based on IP address

Cantor, Scott cantor.2 at osu.edu
Thu Oct 20 15:04:36 EDT 2016


> We use this groovy script to get the client's IP address:

Don't do this:

> // Lookup the ServletContext through Spring
>       def req = ((ServletRequestAttributes)
> RequestContextHolder.currentRequestAttributes()).getRequest()

If you want that object, you need to inject it via the custom object injection feature, and just inject a reference to shibboleth.HttpServletRequest

> Another groovy script evaluates the ip like this:

And we have an IPRange class that is much better to use than bit operations.

-- Scott



More information about the users mailing list