gpt4 book ai didi

mysql - CAS未连接Mysql进行用户认证

转载 作者:行者123 更新时间:2023-12-04 19:25:10 24 4
gpt4 key购买 nike

我是 CAS 的新手。
我喜欢向 Mysql 数据库中的用户列表验证用户身份。我已将这行代码包含在 中build.gradle 文件

implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"
这是Mysql中的表定义。
enter image description here
我在 Ubuntu 服务器中设置了一个 CAS 6.4 实例,禁用了静态用户身份验证并配置了 /etc/cas/config/cas.properties 使用 Mysql 作为数据源进行身份验证,如下配置,所有其他设置保留为默认值:
server.name=https://id.example.com 
server.prefix=${cas.server.name}/
server.context-path=/ server.port=443
server.ssl.key-store=file:/etc/cas/theKeystore
server.ssl.key-store-password=theKeystorePassword
server.ssl.key-password=thePassword

logging.config=file:/etc/cas/config/log4j2.xml

cas.authn.accept.enabled=false

cas.authn.jdbc.query[0].driver-class: com.mysql.jdbc.Driver
cas.authn.jdbc.query[0].field-password: password
cas.authn.jdbc.query[0].password: theDBPassword
cas.authn.jdbc.query[0].sql: SELECT * FROM users WHRE uid=?
cas.authn.jdbc.query[0].url: jdbc:mysql://localhost:3306/cas?useUnicode=true&characterEncoding=utf-8&autoReconnect=true
cas.authn.jdbc.query[0].user: theDBUser
我已将 Mysql 上的 global general_log 设置为 跟踪任何连接尝试。但是,CAS 服务器似乎从未尝试连接到 Mysql 服务器。在用户站点上,他们只是在登录页面上收到尝试失败的消息。
有什么我错过的吗?

最佳答案

似乎不是使用

com.mysql.jdbc.Driver
我需要使用
com.mysql.cs.jdbc.Driver 
作为司机级。

关于mysql - CAS未连接Mysql进行用户认证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71867486/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com