When we use xml based configuration for Spring Security we are able to use <jdbc-user-service>
tag with attributes authorities-by-username-query
and users-by-username-query
to get username, password and role from database for a specific username input.
The code given in Spring Security documentation for Java Configuration seem to be using hard-coded username & password.
The related sample project (spring-security / samples / jdbc-jc) also appears to use the same hard-coded username & password values.
So with Java Configuration, how can we validate the user input with user credentials stored in a database?