#Version
- CAS 6.2.5
- JDK 11
I am new to CAS. Now I'm trying to store all the user credentials in mysql. Below is what I have configure in application.properties:
#cas.authn.accept.users=casuser::Mellon
cas.authn.jdbc.query[0].user=root
cas.authn.jdbc.query[0].password=123456
cas.authn.jdbc.query[0].driver-class=com.mysql.cj.jdbc.Driver
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQLDialect
cas.authn.jdbc.query[0].sql=select * from user_info where username=?
cas.authn.jdbc.query[0].field-password=password
in build.gradle
dependencies {
implementation "org.apereo.cas:cas-server-support-jdbc:${project.'cas.version'}"
}
However, I got this error when filling up the login form:
2020-11-30 07:21:27,694 ERROR [org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <Authentication has failed. Credentials may be incorrect or CAS cannot find authentication handler that supports [UsernamePasswordCredential(username=yaptest, source=null, customFields={})] of type [UsernamePasswordCredential]. Examine the configuration to ensure a method of authentication is defined and analyze CAS logs at DEBUG level to trace the authentication event.>
2020-11-30 07:21:27,694 ERROR
[org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <[QueryDatabaseAuthenticationHandler]: [SQL exception while executing query for yaptest / Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost']>
I'm pretty sure the credential for root account is correct.