Created
December 4, 2016 05:15
-
-
Save ssisaias/1aa49ba0eed6ffb6b786a5ed9bd99bb3 to your computer and use it in GitHub Desktop.
SpringSecurity(4.1.3) Many Table Login example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Login config | |
@Autowired | |
public void configAuthentication(AuthenticationManagerBuilder auth_1, AuthenticationManagerBuilder auth_2) throws Exception { | |
auth_1.jdbcAuthentication().dataSource(dataSource) | |
.usersByUsernameQuery( | |
"select login,password,1 from table1 where login=?") | |
.authoritiesByUsernameQuery( | |
"select login,role from table1 where login=?"); | |
auth_2.jdbcAuthentication().dataSource(dataSource) | |
.usersByUsernameQuery( | |
"select login,password,1 from table2 where login=?") | |
.authoritiesByUsernameQuery( | |
"select login,role from table2 where login=?"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment