Last active
August 29, 2015 14:05
-
-
Save yanhua365/6708882c8f8ae91a3ec6 to your computer and use it in GitHub Desktop.
Spring Security的各种User Service
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
<authentication-manager> | |
<authentication-provider> | |
<user-service> | |
<user name="sa" password="sa" authorities="ROLE_USER,ROLE_ADMIN,ROLE_UC_ADMIN" /> | |
</user-service> | |
</authentication-provider> | |
</authentication-manager> |
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
<authentication-manager alias="authenticationManager"> | |
<authentication-provider> | |
<jdbc-user-service data-source-ref="dataSource" | |
users-by-username-query=" | |
select username, `password`, 'true' | |
from sys_user | |
where username=?;" | |
authorities-by-username-query=" | |
select u.username , r.enName from sys_user_role ur | |
left join sys_user u on ur.user_id=u.id | |
left join sys_role r on ur.role_id =r.id where u.username=?" | |
/> | |
</authentication-provider> | |
</authentication-manager> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment