My web app has multiple authentication managers (one for API one for WEB access). The api should have a basic auth service only - configured via the spring security markup a
Please keep in mind that this Spring Security XML namespace is just a neat way of organizing your XML. You could achieve exactly the same solution with plain <bean>
config. That way you will be able to use ID, as usual. This blog post might be helpful for you.
In namespace the name can be add it in the java
with the @Service("userDetailsService")
with a name.
You can also define beans and add them to the chain.
<bean id="myFilter" class="a.b.c.myFilter">
<security:custom-filter before="BASIC_PROCESSING_FILTER" />
<property name="authenticationManager" ref="_authenticationManager" />
</bean>
<bean id="myProvider" class="a.b.c.myProvider">
<security:custom-authentication-provider />
<property name="userDetailsService" ref="userDetailsService" />
</bean>
<security:http>
[...]
</security:http>
the _authenticationManager
is the name of the bean that is registered in namespace.
This would be executed before the basic auth.