How to add various users to make conection with database in CAS v5.1.5

33 views
Skip to first unread message

Diego Andres carvajal Ruiz

unread,
Sep 14, 2018, 6:32:56 PM9/14/18
to CAS Community
Hi everyone, I've CAS v5.1.5 in Wildfly 10. Actually I have only 1 node of CAS, but I want to create more nodes with differents users to connect to the database but I don't know how to do it. It's possible in the cas.properties file add the follow lines and will it work?:

cas.authn.jdbc.query[0].sql=SELECT ******
cas.authn.jdbc.query[0].driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
cas.authn.jdbc.query[0].url=jdbc:sqlserver://ip:port ;databaseName=***
cas.authn.jdbc.query[0].user=user
cas.authn.jdbc.query[0].password=user_passwd

cas.authn.jdbc.query[1].sql=SELECT ******
cas.authn.jdbc.query[1].driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
cas.authn.jdbc.query[1].url=jdbc:sqlserver://ip:port ;databaseName=***
cas.authn.jdbc.query[1].user=user1
cas.authn.jdbc.query[1].password=user1_passwd

cas.authn.jdbc.query[2].sql=SELECT ******
cas.authn.jdbc.query[2].driverClass=com.microsoft.sqlserver.jdbc.SQLServerDriver
cas.authn.jdbc.query[2].url=jdbc:sqlserver://ip:port ;databaseName=***
cas.authn.jdbc.query[2].user=user2
cas.authn.jdbc.query[2].password=user2_passwd

Or can you give me your opinions about mi topic.

Thanks!




Ray Bon

unread,
Sep 17, 2018, 12:49:55 PM9/17/18
to cas-...@apereo.org
Diego,

When setting multiple authentications, CAS will try each one until authentication success. If the database name is different for each user, below should work. If you want each CAS server to use a different user but same database (auditing?), then each CAS server will need its own unique config file.

Ray
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

Diego Andres carvajal Ruiz

unread,
Sep 24, 2018, 10:12:21 AM9/24/18
to CAS Community
Thanks a lot Ray!
Reply all
Reply to author
Forward
0 new messages