Need help with CAS 5.0.0 with PostgreSQL JDBC authentication source

1,013 views
Skip to first unread message

mrcasa

unread,
Nov 9, 2016, 9:39:58 AM11/9/16
to CAS Community
Hi!

New to CAS 5 and gradle cas overlay. I'm trying to get authentication against postgresql 9.6.1 jdbc working.

Here what I did,

* cloned gradle overlay https://github.com/apereo/cas-gradle-overlay-template.git
* created keystore
* compiled and started cas.war
* default username/password casuser/Mellon works - https://localhost:8443/cas/login

Updated /etc/cas/config/cas.properties for jdbc source -

cas.server.name: https://cas.example.org:8443
cas.server.prefix: https://cas.example.org:8443/cas

endpoints.enabled=true
management.contextPath=/status
cas.adminPagesSecurity.ip=127\.0\.0\.1

logging.config: file:/etc/cas/config/log4j2.xml
# cas.serviceRegistry.config.location: classpath:/services

cas.authn.accept.users=

cas.authn.jdbc.query[0].sql=SELECT password FROM user_table WHERE emailaddress=?
cas.authn.jdbc.query[0].healthQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
cas.authn.jdbc.query[0].isolateInternalQueries=false
cas.authn.jdbc.query[0].url=jdbc:postgresql://localhost:5432/users
cas.authn.jdbc.query[0].failFast=true
cas.authn.jdbc.query[0].isolationLevelName=ISOLATION_READ_COMMITTED
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.PostgreSQLDialect
cas.authn.jdbc.query[0].leakThreshold=10
cas.authn.jdbc.query[0].propagationBehaviorName=PROPAGATION_REQUIRED
cas.authn.jdbc.query[0].batchSize=1
cas.authn.jdbc.query[0].user=postgres
cas.authn.jdbc.query[0].ddlAuto=create-drop
cas.authn.jdbc.query[0].maxAgeDays=180
cas.authn.jdbc.query[0].password=postgres
cas.authn.jdbc.query[0].autocommit=false
cas.authn.jdbc.query[0].driverClass=org.postgresql.Driver
cas.authn.jdbc.query[0].idleTimeout=5000
cas.authn.jdbc.query[0].credentialCriteria=
cas.jdbc.showSql=true
cas.jdbc.genDdl=true
spring.jpa.show-sql=true

cas.authn.jdbc.query[0].passwordEncoder.type=NONE

===

I get invalid credentials and I see in the logs -

===
...
2016-11-09 20:02:09,380 WARN [org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <Authentication has failed. Credentials may be incorrect or CAS cannot find authentication handler that supports [x...@xxx.com] of type [UsernamePasswordCredential], which suggests a configuration problem.>
...
...
2016-11-09 20:02:09,436 ERROR [org.apereo.cas.web.flow.AuthenticationExceptionHandler] - <Unable to translate handler errors of the authentication exception org.apereo.cas.authentication.AuthenticationException: 0 errors, 0 successes. Returning UNKNOWN by default...>
...
====

I'm sure I have not configured it correctly and would appreciate some help

Thanks!

guz

unread,
Nov 16, 2016, 9:18:42 PM11/16/16
to CAS Community
 I have this log too, would appreciate some help

Daniel

unread,
Nov 17, 2016, 8:55:13 AM11/17/16
to CAS Community
I'm getting this error with a new LDAP configuration. Probably unrelated but I am interested in seeing how this resolves.

Michael Zhang

unread,
Jan 13, 2017, 3:44:03 AM1/13/17
to CAS Community
Me too. Looking for a solution. 

sesharaju sv

unread,
Jan 13, 2017, 9:01:50 AM1/13/17
to CAS Community
Me too looking for the same solution (LDAP). Assume its bit related with configuration but not sure on the same.

Thanks
Seshu

mrcasa bengaluru

unread,
Jan 14, 2017, 2:59:33 PM1/14/17
to cas-...@apereo.org
All,

I resolved this by putting appropriate dependencies of cas modules in my build.gradle.  The dependency here was cas-server-support-jdbc If you are using maven-overlay, add the dependency in your pom.xml

The configuration in cas.properties for jdbc wont work until the module is compiled into cas.war via the overlay project.

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/b59c16a9-dad8-4fa2-a20b-124d4e544e98%40apereo.org.

Reply all
Reply to author
Forward
0 new messages