November 2017
Intermediate to advanced
542 pages
14h 24m
English
In order to use custom SQL queries for our non-standard schema, we'll simply update our userDetailsService() method to include new queries. This is quite similar to how we enabled support for GBAC, except instead of using the default SQL, we will use our modified SQL. Notice that we remove our old setGroupAuthoritiesByUsernameQuery() method call, since we will not be using it in this example, in order to keep things simple:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java private static String CUSTOM_USERS_BY_USERNAME_QUERY = ""+ "select email, password, true " + "from calendar_users where email = ?"; private static String CUSTOM_AUTHORITIES_BY_USERNAME_QUERY ...
Read now
Unlock full access