First you need to specify customAuthenticationProvider, for example:
<bean id="customAuthenticationProvider" class="your.project.CustomAuthenticationProviderImpl">
<property name="userDetailsService" ref="userDetailsService" />
...
</bean>
<security:authentication-manager>
<security:authentication-provider ref="customAuthenticationProvider" />
</security:authentication-manager>
Your own authentication provider can then extend Spring Security AbstractUserDetailsAuthenticationProvider, where you can place your own authentication code.
public class CustomAuthenticationProviderImpl extends AbstractUserDetailsAuthenticationProvider {
...
}
source
share