Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom ConcurrentSessionControlStrategy
    primarykey
    data
    text
    <p>I'm using spring-security 3.1.</p> <p>I have to implement session concurrency strategy in a way that the maximum number of sessions is specified by user. Here is what I did : </p> <p>Coded a class extending org.springframework.security.web.authentication.session.ConcurrentSessionControlStrategy and overrode the method </p> <p><code>protected int getMaximumSessionsForThisUser(Authentication authentication)</code></p> <p>I configured it using namespace configuration : </p> <pre><code>&lt;security:http&gt; ... &lt;security:session-management session-authentication-strategy-ref="mySessionAuthenticationStrategy"/&gt; ... &lt;/security:http&gt; &lt;bean id="mySessionAuthenticationStrategy" class="foo.bar.MySessionAuthenticationStrategy"&gt; &lt;constructor-arg ref="sessionRegistry"/&gt; &lt;/bean&gt; &lt;bean id="sessionRegistry" class="org.springframework.security.core.session.SessionRegistryImpl" /&gt; </code></pre> <p>The problem is that "MySessionAuthenticationStrategy" is never called :(</p> <p>I digged in spring api to see that the following line(70) in <code>SessionManagementFilter</code> is false (preventing any <code>SessionAuthenticationStrategy</code> to be invoked) : </p> <pre><code>if (!securityContextRepository.containsContext(request)) </code></pre> <p>Why is that ? I read the documentation where they suggest to set the session authentication strategy in the <code>UsernamePasswordAuthenticationFilter</code>, but it's not an option for me since I'm combining form login with SAML login plus a <code>PreAuthentication</code> mechanism validating authentication token (3 different authentication mechanisms).</p> <p>Any of you can help ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload