【发布时间】:2019-12-12 06:47:14
【问题描述】:
我之前的question 的继续。我正在研究 CAS 5 以根据我的需要进行修改。在CAS tutorial 的帮助下,我现在已经完成了自定义身份验证。现在我在pom.xml 中添加了以下依赖项,以通过关注link 连接到数据库。
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc</artifactId>
<version>${cas.version}</version>
</dependency>
并在application.properties中添加了数据库认证属性
cas.authn.jdbc.query[0].sql=some query
cas.authn.jdbc.query[0].url=jdbc:postgresql://127.0.0.1/dbcas
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.PostgreSQLDialect
cas.authn.jdbc.query[0].user=readonly
cas.authn.jdbc.query[0].password=readonly
cas.authn.jdbc.query[0].ddlAuto=none
cas.authn.jdbc.query[0].driverClass=org.postgresql.Driver
但它不起作用意味着得到
类型 'org.apereo.cas.configuration.model.support.jdbc.QueryJdbcAuthenticationProperties' 没有属性“url”
我在这里有什么遗漏吗?任何人都请帮助我。
更新:
我查过QueryJdbcAuthenticationProperties的来源
@RequiredProperty
private String sql;
还有AbstractJpaProperties
private String dialect;
private String ddlAuto;
@RequiredProperty
private String driverClass;
@RequiredProperty
private String url;
@RequiredProperty
private String user;
@RequiredProperty
private String password;
我在 cas-server-core-api-configuration-model-5.3.2.jar 文件中找到了相同的两个类,而这两个在任何其他包和 jar 文件中都找不到。
这里有什么问题。我无法识别它。
如何知道这些属性 (
cas.authn.jdbc.query) 的位置 定义?
在定义这些数据库属性时,我认为该对象已创建 w.r.t 子类 QueryJdbcAuthenticationProperties。
【问题讨论】:
-
您是否确认可以连接到
127.0.0.1/dbcas?看来您缺少端口。 -
@leopal,这种情况下会使用默认端口,所以这里没问题...
-
至少有一部分错误的堆栈跟踪会很方便 - 它可以帮助您/我们更好地识别错误发生的位置。
-
@leopal,这里我发布的示例代码不完全一样。
-
@PetrBodnár,没有堆栈跟踪可以发布它在 Eclipse 中显示。
标签: spring postgresql cas single-logout