- <authentication> tags links to DaoAuthenticationProvider and calls the UserDatailsService implementation
Storing User Details in Application Context
- When the number of users for the application are less, we can directly add the login and passwords in XML
- org.springframework.security.core.userdetails.memory.InMemoryDaoImpl bean is initalized for <user-service>
Configuration to Store Login Details in Application Context

Storing User Details in Database
- When the number of users for the application are more, the login and passwords are stored in the database
- org.springframework.security.core.userdetails.jdbc.Jdbc DaoImpl class is used
Configuration to Store Login Details in Database

Storing Username and Password (Cont’d)
Storing User Details in Custom User Table
- To store and retrieve Login details from a custom table, configure the fetch queries, to be executed for getting the user credentials
Configuration to alter fetch query to get credentials from USER table with id, username, password columns and Role table which has username, role columns
