To make ip address available to whatever you want you can use the Acegi configuration of CAS. I do that in my case. First you should create a context that implements org.acegisecurity.context.SecurityContextImpl to save your data like ip address, session id, etc. Second you should create a filter to set this information to your security context and the next step is configuration. In web.xml changes the url pattern that Acegi Filter Chain Proxy going to filter from /services/* to /* and in the securityContext.xml change this:
<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"> <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /**=httpSessionContextIntegrationFilter,logoutFilter,casProcessingFilter ,exceptionTranslationFilter,filterInvocationInterceptor </value> </property> </bean> To this <bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"> <property name="filterInvocationDefinitionSource"> <value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /login = httpSessionContextIntegrationFilter, ipAddressSessionIdSetterFilter /services/**=httpSessionContextIntegrationFilter,logoutFilter,casProcess ingFilter,exceptionTranslationFilter,filterInvocationInterceptor </value> </property> </bean> ipAddressSessionIdSetterFilter is your filter that set the data to the security context and should be configured as a bean change this too <bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"> <property name="context"> <value>package.path.to.your.CASContext</value> </property> </bean> Next do what you want with the saved data when you want simple doing ((CASContext)SecurityContextHolder.getContext()).CASContextMethod() _______________________________________________ Yale CAS mailing list [email protected] http://tp.its.yale.edu/mailman/listinfo/cas
