Create multiple queries on the Apereo CAS server

29 Views Asked by At

I'm currently implementing SSO using Apereo CAS 6.6.x. I have deployed CAS Server, connected two different services with CAS, and successfully logged in using database-based authentication.

I heard that CAS is designed to be scalable by decoupling the application and session storage for authentication, so I naturally thought that CAS Server should be connected to multiple databases.

I've looked at the official documentation to implement my idea, but it doesn't seem to be there, so I'm posting a question. The application.yml file I set up is as follows.

cas:
  authn:
    jdbc:
      query[0]:
        driver-class: "com.mysql.cj.jdbc.Driver"
        url: "jdbc:mysql://{My Public IP}:3306/test?autoReconnect=true&allowMultiQuries=true&serverTimezone=UTC"
        sql: "select id, login_id, login_pw from test.sso where login_id = ?;"
        user: "mysql"
        password: "root"
        field-user: "login_id"
        field-password: "login_pw"
        password-encoder:
          type: "NONE"
      query[1]:
        driver-class: "com.mysql.cj.jdbc.Driver"
        url: "jdbc:mysql://{My Public IP}:3306/test2?autoReconnect=true&allowMultiQueries=true&serverTimezone=UTC"
        sql: "select id, username, password from test2.kva_user where username = ?;"
        user: "mysql"
        password: "root"
        field-user: "username"
        field-password: "password"
        password-encoder:
          type: "NONE"

However, CAS Server only fired the query for query[0] and did not react to query[1]. Intuitively, query[0] should have query[1], so I don't see why it shouldn't.

Here's one part of the official documentation I'm looking at, is this possible to implement what I want?

link

0

There are 0 best solutions below