Foros de discusión

Logging and debugging CAS authenticator

Dicta Artisan, modificado hace 6 años.

Logging and debugging CAS authenticator

New Member Mensajes: 7 Fecha de incorporación: 23/08/17 Mensajes recientes
Hi all

I'm having issues setting up CAS authentication with Liferay 7 so I'm trying to enable debugging in the SSO module to see what is going on. I'm trying to enable logging of the "com.liferay.portal.security.sso.cas" OSGI bundle but this doesn't seem to work. I've followed the guide here

https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/adjusting-module-logging

In particular, I setup the file

<liferay_home>/osgi/log4j/com.liferay.portal.security.sso.cas-log4j-ext.xml

which contains

<!--?xml version="1.0"?-->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <category name="com.liferay.portal.security.sso.cas">
        <priority value="DEBUG" />
    </category>
</log4j:configuration>


Yet I do not see any logs created - neither in <liferay_home>/logs, nor in the container logs.

This happens with the 7.0-GA4 bundle, be it Wildfly or Tomcat versions.

Anyone has any suggestions what I am doing wrong/what needs fixing to enable these logs?

BTW, neither the CAS properties setup via {LIFERAY_HOME}/osgi/configs/com.liferay.portal.security.sso.cas.module.configuration.CASConfiguration.cfg seems to work, I have to set up the CAS server configuration manually via the web interface.

Again, this is with a fresh install from the bundle

Thanks for any suggestions...
Dicta Artisan, modificado hace 6 años.

RE: Logging and debugging CAS authenticator

New Member Mensajes: 7 Fecha de incorporación: 23/08/17 Mensajes recientes
Well, in the end just figured out that there is a bug in the documentation, the name of the configuration file for the CAS authentication module should be

{LIFERAY_HOME}/osgi/configs/com.liferay.portal.security.sso.cas.configuration.CASConfiguration.cfg
Dicta Artisan, modificado hace 6 años.

RE: Logging and debugging CAS authenticator

New Member Mensajes: 7 Fecha de incorporación: 23/08/17 Mensajes recientes
Well, I spoke too soon

The file gets read and the CAS configuration settings are set and visible into the "System configuration" interface, but they do not get applied to the instance configuration. This is with a fresh installation of liferay where the configuration file gets saved in osgi/configs before the first server start. Whatever I do I can not automatically configure the CAS authentication for the instance via the config file.

If I do edit the blank CAS system configurations via the web interface and save it then they get applied to the instance as well... odd...

Any feedback would be appreciated
Dicta Artisan, modificado hace 6 años.

RE: Logging and debugging CAS authenticator

New Member Mensajes: 7 Fecha de incorporación: 23/08/17 Mensajes recientes
Still answering my own questions, I find that to pre-configure the CAS authentication via the config files for a fresh install one has to do the following:

- install liferay without the cas config file
- start up the server (i presume this somehow initialises some defaults as it creates the database tables)
- stop the server
- copy the config file to the osgi/configs folder
- start the server

then the CAS authentication is in place in the instance settings as well as for system settings