java - Spring security does not work -
i getting error when try login (or, when abort http basic dialog escape)
http status 401 - preparedstatementcallback; bad sql grammar [select username,authority authorities username = ?]; nested exception org.postgresql.util.psqlexception: error: relation "authorities" not exist position: 32
however, shouldn't enough 2 query attributes below when want use group based security? need define query attribute to? authorities-by-username-query=""
why isn't working?
<security:authentication-manager> <security:authentication-provider> <security:jdbc-user-service data-source-ref="datasource" users-by-username-query="..." group-authorities-by-username-query="..." /> </security:authentication-provider> </security:authentication-manager>
source jdbcdaoimpl:
if (enableauthorities) { dbauthsset.addall(loaduserauthorities(user.getusername())); } if (enablegroups) { dbauthsset.addall(loadgroupauthorities(user.getusername())); }
is problem enablegroups still set false? doesn't seem there's way configure using jdbc-user-service element in namespace configuration. spring jira issue sec-1625 seems confirm this.
try declaring jdbcdaoimpl instance bean instead.
Comments
Post a Comment