I everyone, I use Shiro with Spring into a Webapp. And I need to count
logged users. So I will use AuthenticationListener but I'm unable to find
how to add the listener to an Authenticator..It seems that only subclasses
of AbstractAuthenticator can receive a list of AuthenticationListener but I
don't know how to access it.
Here is my application context :
<bean id="myrealm" class="me.myapp.security.ShiroUserSecurityProvider">
<constructor-arg type="me.myapp.services.UserService" ref="userService" />
</bean>
<bean id="securityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="myrealm"/>
</bean>
<bean id="authenticationListener"
class="me.myapp.security.ShiroAuthenticationListener" />
<bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager"/>
<property name="loginUrl" value="/ui/login"/>
<property name="filterChainDefinitions">
<value>
# some example chain definitions:
/ui/login = anon
/ui/** = authc, user, currentUserIntegrationFilter
# more URL-to-FilterChain definitions here
</value>
</property>
</bean>
Thanks