之前使用默認賬戶名密碼登錄是ok的
然后加上資料庫后失敗;
新增的配置:
pom.xml:
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jdbc-drivers</artifactId>
<version>${cas.version}</version>
</dependency>
新增的properties:
#Query Database Authentication 資料庫查詢校驗用戶名開始
#查詢賬號密碼sql,必須包含密碼欄位
cas.authn.jdbc.query[0].sql=select * from casuser where username=?
#指定上面的sql查詢欄位名(必須)
cas.authn.jdbc.query[0].fieldPassword=password
#資料庫驅動
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
#資料庫連接
cas.authn.jdbc.query[0].url=jdbc:mysql://localhost:3306/cas?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT&allowPublicKeyRetrieval=true
#資料庫用戶名
cas.authn.jdbc.query[0].user=root
#資料庫密碼
cas.authn.jdbc.query[0].password=xxxxx
#Query Database Authentication 資料庫查詢校驗用戶名結束
資料庫和表都是對的
加上這些后輸入賬密就不能登錄了:
WHO: audit:unknown
WHAT: [event=success,timestamp=Fri May 29 18:48:31 CST 2020,source=RankedAuthenticationProviderWebflowEventResolver]
ACTION: AUTHENTICATION_EVENT_TRIGGERED
APPLICATION: CAS
WHEN: Fri May 29 18:48:31 CST 2020
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================
>
2020-05-29 18:48:41,201 WARN [org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <Authentication has failed. Credentials may be incorrect or CAS cannot find authentication handler that supports [liaozeyu] of type [UsernamePasswordCredential], which suggests a configuration problem.>
2020-05-29 18:48:41,210 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: liaozeyu
WHAT: Supplied credentials: [liaozeyu]
ACTION: AUTHENTICATION_FAILED
APPLICATION: CAS
WHEN: Fri May 29 18:48:41 CST 2020
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/16680.html
標籤:MySQL
上一篇:如何獲取虛擬數字火幣的實時行情?
