[英]Spring security does not work
I am getting an error when I try to login (or, when I abort the HTTP Basic dialog with escape) 尝试登录时出现错误(或者,当我使用转义中止HTTP Basic对话框时)
HTTP Status 401 - PreparedStatementCallback;
HTTP状态401-PreparedStatementCallback; bad SQL grammar [select username,authority from authorities where username = ?];
错误的SQL语法[从用户名=?的位置选择用户名,授权]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "authorities" does not exist Position: 32
嵌套的异常是org.postgresql.util.PSQLException:错误:关系“权限”不存在位置:32
However, shouldn't it be enough with the two query attributes below when I want to use group based security? 但是,当我想使用基于组的安全性时,下面的两个查询属性是否还不够? Do I need to define query for this attribute to?
我是否需要为此属性定义查询?
authorities-by-username-query=""
Why isn't it working? authorities-by-username-query=""
为什么不起作用?
<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 from JdbcDaoImpl: 来自JdbcDaoImpl的来源:
if (enableAuthorities) {
dbAuthsSet.addAll(loadUserAuthorities(user.getUsername()));
}
if (enableGroups) {
dbAuthsSet.addAll(loadGroupAuthorities(user.getUsername()));
}
Is the problem that enableGroups is still set to false? enableGroups仍然设置为false的问题吗? It doesn't seem like there's a way to configure that using the jdbc-user-service element in the namespace configuration.
似乎没有一种方法可以在名称空间配置中使用jdbc-user-service元素进行配置。 The Spring JIRA issue SEC-1625 seems to confirm this.
JIRA春季问题SEC-1625似乎证实了这一点。
Try declaring the JdbcDaoImpl instance as a bean instead. 尝试将JdbcDaoImpl实例声明为Bean。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.