CAS未连接到MySQL以进行用户身份验证

发布于 2025-01-21 05:10:15 字数 1324 浏览 3 评论 0原文

我是CAS的新手。

我喜欢将用户身份验证为MySQL数据库中的用户列表。我已经在 build.gradle 文件中包含了此代码行,

implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"

这是MySQL中的表格。

我已经在Ubuntu Server中设置了CAS 6.4的实例对于以下配置的身份验证,所有其他设置默认为默认设置:

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上的全局通用_log设置为上的 on 以追踪任何连接尝试。但是,CAS服务器似乎从未尝试连接到MySQL Server。在用户站点上,他们只是在登录页面上仅收到了尝试失败的消息。

我想念什么吗?

I'm new to CAS.

I like to authenticate user to the list of users inside the Mysql database. I have included this line of code in the build.gradle file

implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"

Here is the table defination in Mysql.

enter image description here

I have setup an instance of CAS 6.4 in Ubuntu server, disabled static user authentication and configure the /etc/cas/config/cas.properties to use Mysql as data source for authentication as config below, all other settings leave as default:

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

I have set global general_log on Mysql to ON to trace any connection attempt. However, it seems the CAS server never try to connect to the Mysql server. On user site, they simply received attempt failed message on login page.

Is there anything I've missed?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浮生面具三千个 2025-01-28 05:10:15

看来

com.mysql.jdbc.Driver

我不需要用作

com.mysql.cs.jdbc.Driver 

驱动程序级。

It seems that instead of using

com.mysql.jdbc.Driver

I need to use

com.mysql.cs.jdbc.Driver 

as driver-class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文