How to setup the JAAS LoginModule on tomcat?

I want to use the JAAS DirectAccessGrantsLoginModule on an application, which runs on tomcat (Comsol Server).

Below is the config in the application and the auxilliary keycloak.json. There are some sample configs, which I followed, but in general the config for the particular LoginModule is governed by the module itself. So I followed the docs of the JAAS Plugin and this example. I had some difficulties to get the module recognized at all by the application / tomcat, but finally that worked. I inserted the keycloak-adapter-core 21.1.1 from jar-download com together with a bunch of dependencies in /bin/tomcat/lib/, so now the login module is found.

ComsolServerLogin {
    org.keycloak.adapters.jaas.DirectAccessGrantsLoginModule required 
    com.comsol.jaas.ComsolServiceLoginModule optional

Here the keycloak.json:

  "realm" : "xxx",
  "resource" : "comsol",
  "auth-server-url" : "",
  "ssl-required" : "all",

      "credentials": {
        "secret": "kGHv..."

The error the application reports is


Any ideas where to start with troubleshooting? This is Keycloak 21.1.1.