java - How to get a reference to SessionAuthenticationStrategy without configuring the strategy explicit? -


In a Spring security 3.2 based application I have been clearly configured Username Password Confirmation Filter , For which reference is needed sessionAuthenticationStrategy ( .onAuthentication to call in order. *

sessionAuthenticationStrategy default > & lt; Security: http & gt; ( HttpSecurityBeanDefinitionParser ).

My question: How can I get a reference for SessionAuthenticationStrategy complete is without configuring SessionAuthenticationStrategy explicite, so that I inject this Can reference in XML configuration?

  & lt; Security: http auto-mechanism = "false" use-expression = "true" entry-point-riff = "login url authentication enterpoint" access-decision -manager- ref = "httpAccessDecisionManager" & gt; ... & lt; Security: custom-filter ref = "user name password authentication filter" status = "FORM_LOGIN_FILTER" /> ... & lt; / Security: http & gt; ... & lt; Bean id = "User name password authentication filter" class = "o.s.scurity.web.authentication.UsernamePasswordAuthenticationFilter" & gt; & Lt; Property Name = "sessionAuthenticationStrategy" ref = "????" & Gt; & Lt ;! - ?? - & gt; ... & lt; / Bean & gt;  

* My real Username Password AuthorAuthenticationFilter is a customized subclass, but it should not make any difference to this question

<
Code>) is the class responsible for parsing to create security: http tag and sessionAuthenticationStrategy bean.

So I know Spring Protection 3.2. 5. Create RELEASE (in my configuration) A Composite session uses Autonautication Strategy as the Same and Session Strategy This bean default name will be found: org.springframework.security.web.authentication .session.CompositeSessionAuthenticationStrategy # 0

So my current workaround is a reference to this bean, by its name:

  & lt; Beam id = "usernamename password authentication filter" class = "osscurity.web.authentication.UsernamePasswordAuthenticationFilter" & gt; & Lt; Property Name = "sessionAuthenticationStrategy" & gt; & Lt; Ref bean = "org.springframework.security.web.authentication.session.Composite session authorization # 0" />> & lt; / Property & gt; ... & lt; / Bean & gt;  

There are some serious limitations in this solution:

  • When a new version of spring protection work (making another bean) fails in another way # 0
  • When any other holistic processing authority that code is created with ReaderContext.generateBeanName , then # 0 may be # 1 (depending on the order in which the beans are made)

Comments

Popular posts from this blog

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

c# - WPF Expander overlay used in ItemsControl -

android - how to get distance of 2 beacons and make a condtion base on that distance -