I am using spring-security for doing basic authentication in my application. Can we have more than one authentication provider like from xml and from db also. How to configure them?
You can have as many as you would like. It will try them in order and if all have been tried a suitable exception will be thrown. You can provide multiple <security:authentication-provider> tags inside the <security:authentication-manager> namespace. Alternatively you can declare a bean of type org.springframework.security.providers.ProviderManager and set a list of providers on it.