SEC-1911: <security:debug/> enables SecurityDebugBeanFactoryPostProcessor which ignores <context:annotation-config/> #2139

Closed
spring-issuemaster opened this Issue Feb 7, 2012 · 3 comments

Projects

None yet

2 participants

@spring-issuemaster

kevin s (Migrated from SEC-1911) said:

<bean id="customBasedAuthenticationProvider" class="com.test.admin.auth.CustomBasedAuthenticationProvider">
    <property name="configBean" ref="annotationBean" />
</bean>


<context:annotation-config/>
<security:debug/> 

 <security:authentication-manager>
    <security:authentication-provider ref="customBasedAuthenticationProvider">
    </security:authentication-provider>
</security:authentication-manager>

configBean

@Component("annotationBean")
@Scope(BeanDefinition.SCOPE_SINGLETON)
public class AnnotationConfigBean implements InitializingBean {
@Autowired
public AutowiredBean bean;

/* (non-Javadoc)
 * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
 */
@Override
public void afterPropertiesSet() throws Exception {
    if(bean==null)
        throw new RuntimeException("noconfigbean");

}

}

autowiredBean

@Component
public class AutowiredBean {

}

when injecting annotationBean into customBasedAuthenticationProvider the @Autowired AutowiredBean is not set on the annotationBean. This occurs only when security:debug/ is enabled.

@spring-issuemaster

Rob Winch said:

I believe this is a duplicate of SEC-1885. Can you please try the latest snapshot and let me know if this is resolved for you.

@spring-issuemaster

Rob Winch said:

Resolving as duplicate due to no feedback otherwise

@spring-issuemaster

This issue duplicates #2113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment