Hi Team,

I have configured PathBasedKeycloakConfigResolver in my package: com.demo.util.

The context param has been set on web.xml
<context-param>
        <param-name>keycloak.config.resolver</param-name>
        <param-value>org.keycloak.example.PathBasedKeycloakConfigResolver</param-value>
    </context-param>

I deployed the application on Tomcat. I have registered the context.xml in meta-inf with the required adapter.

Tomcat lib directory has all the required keycloak jar files.

But PathBasedKeycloakConfigResolver never gets called on any request to the url.
One strange thing i find that in eclipse if I remove the maven dependency from deployment assembly(right click on project-> properties->deployment assembly) it works But if i put it back it fails. Maven dependency is a must.

After debugging   String configResolverClass = context.getServletContext().getInitParameter("keycloak.config.resolver"); of AbstractKeycloakAuthenticatorValve class

Got the following error: when PathBasedKeycloakConfigResolver  is being instantiated.

java.lang.ClassCastException: org.keycloak.example.PathBasedKeycloakConfigResolver cannot be cast to org.keycloak.adapters.KeycloakConfigResolver

But PathBasedKeycloakConfigResolver implements org.keycloak.adapters.KeycloakConfigResolver.


Regards,
Satya.