Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

More than one authentication provider in spring-security?

 
kuldeep sidhu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic