Using JdbcUserDetailsManager vs own UserDetailsService

I am learning about Spring Security and I don't understand completly if I should use JdbcUserDetailsManager or a custom implementation of UserDetailsService. I am using a database for storing users.

I don't get what the JdbcUserDetailsManager gives you apart from a lot of methods, which I am not sure that I want to use? What if you have validations etc? Do you wrap it in a own implementation of UserDetailsService?

I mean, would you leak this manager class througout your application. Is it better to create your own?

Answers


There are some differences:

  1. UserDetailsService is the core interface to load user details and is used by DaoAuthenticationProvider.
  2. UserDetailsService has a sub-interface the defines CRUD operations on the abstraction of a user: UserDetailsManager
  3. JdbcDaoImpl is a JDBC implementation of UserDetailsService.
  4. JdbcUserDetailsManager is a JDBC implementation of UserDetailsManager and an extension of JdbcDaoImpl. It also provides the interface GroupManager

Based on the differences, it may affect how you decide which to use, expose, wrap or even implement.


Need Your Help

Lining two elements responsively

css alignment responsiveness

I'm working with a website and I want to get a h1 header on top of the page to line exactly with a specific text in a navbar below it. I don't know how to accomplish this and would appreciate some ...

How do I restore from a drop database command using a mysql binary log?

mysql database recovery

How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.