Attribute release based on IP address
Niva Agmon
nagmon at temple.edu
Thu Oct 20 16:05:52 EDT 2016
Thanks for the scripts, Robert, and sorry for not stating the use case very clearly.
It is:
* We have an application for use by dorm residents. Currently, authorization is done through the eduPersonEntitlement attribute, based on a script in attribute resolver.
* We were asked to let anyone who is logging in from the pc labs on campus to also use this application.
Thanks,
Niva
-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Cantor, Scott
Sent: Thursday, October 20, 2016 3:05 PM
To: Shib Users <users at shibboleth.net>
Subject: RE: Attribute release based on IP address
> 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
--
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
More information about the users
mailing list