Skip to content

Commit

Permalink
fix table case
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodyiam committed Sep 11, 2017
1 parent 88494d7 commit de03435
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,20 @@ public LogoutHandler logoutHandler() {

@Bean
public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception {
return auth.jdbcAuthentication().passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource)
.usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username=?")
JdbcUserDetailsManager jdbcUserDetailsManager = auth.jdbcAuthentication().passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource)
.usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username = ?")
.authoritiesByUsernameQuery("select Username,Authority from `Authorities` where Username = ?")
.getUserDetailsService();

jdbcUserDetailsManager.setUserExistsSql("select Username from `Users` where Username = ?");
jdbcUserDetailsManager.setCreateUserSql("insert into `Users` (Username, Password, Enabled) values (?,?,?)");
jdbcUserDetailsManager.setUpdateUserSql("update `Users` set Password = ?, Enabled = ? where Username = ?");
jdbcUserDetailsManager.setDeleteUserSql("delete from `Users` where Username = ?");
jdbcUserDetailsManager.setCreateAuthoritySql("insert into `Authorities` (Username, Authority) values (?,?)");
jdbcUserDetailsManager.setDeleteUserAuthoritiesSql("delete from `Authorities` where Username = ?");
jdbcUserDetailsManager.setChangePasswordSql("update `Users` set Password = ? where Username = ?");

return jdbcUserDetailsManager;
}

@Bean
Expand Down

0 comments on commit de03435

Please sign in to comment.