Hi,
I have a flex application that uses BlazeDS. I secure my application using Spring Security. I can login and logout without a problem, but I need to track that a user is logged in. Most importantly, I need to know when a user (session) disconnects. My security context has the following:
The two things I want to do is execute a custom method to know when a user:Code:<security:global-method-security secured-annotations="enabled" jsr250-annotations="enabled" /> <bean id="preAuthenticatedEntryPoint" class="org.springframework.security.web.authentication.Http403ForbiddenEntryPoint"/> <security:http entry-point-ref="preAuthenticatedEntryPoint"> <security:anonymous enabled="false" /> <security:intercept-url pattern="*.swf" access="ROLE_USER"/> </security:http> <bean id="userDetailService" class="com.mycompany.security.UserDetailsService" init-method="initContext"> <property name="userService" ref="userService" /> </bean> <security:authentication-manager> <security:authentication-provider user-service-ref="userDetailService"> <security:password-encoder hash="md5"/> </security:authentication-provider> </security:authentication-manager>
1) logs in
2) logs out
3) session expires
4) disconnects without logging out
I've tried putting in a custom filter for logout like:
but my filter never gets called even though on the client I issue a Channel.logout() command.Code:<bean id="logoutSuccessHandler" class="com.mycompany.security.TomsLogoutHandler"/> <bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter"> <constructor-arg index="0" ref="logoutSuccessHandler"/> <constructor-arg index="1"> <list> <ref bean="securityContextLogoutHandler"/> </list> </constructor-arg> </bean> <bean id="securityContextLogoutHandler" class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler"/> <security:http entry-point-ref="preAuthenticatedEntryPoint"> <security:anonymous enabled="false" /> <security:intercept-url pattern="*.swf" access="ROLE_USER"/> <security:custom-filter ref="logoutFilter" position="LOGOUT_FILTER"/> </security:http>
web.xmlI've searched the web to try and find a way to preserve the simplicity of the spring-based authentication and have been unable to get any of the ideas to work.Code:<!-- SECURITY FILTERS --> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Thanks in advance.


Reply With Quote
