Why is ovewriting configs not supported in all kind of configs?

43 views
Skip to first unread message

Freedom K

unread,
Dec 1, 2022, 10:10:16 AM12/1/22
to CAS Community
Hi everyone,

I am facing an issue when trying to create a config file hierarchy for cas.

I am using something like the below arguments in the run line of cas
--spring.config.location=conf/cas_base.properties,conf/cas_custom.properties

so as to be able to have some hierarchy of configs based on some environment specific preferences.

I have noticed that if I set for example logging.level.org.apereo.cas=DEBUG in the file cas_base.properties and no logging.level.org.apereo.cas is set to cas_custom.properties, it is read from cas and I can see the logs in debug mode, as expected.

However, if I set cas.authn.pac4j.saml[0].clientName in cas_base.properties and not in cas_custom.properties, then the app does not read it and I cannot get redirected to the identity provider I wish (OKTA).

Is there any differences between the different type of configs that prevents them from being able to work with a hierarchy type of config file reading?

The CAS version I am using is 5.2.9

Thanks,
Ria



Ray Bon

unread,
Dec 1, 2022, 11:42:36 AM12/1/22
to cas-...@apereo.org
Ria

This sounds more like a spring config issue than a cas one.
This logger may provide some details:

<AsyncLogger name="org.apereo.cas.config" level="debug" />

Ray

On Thu, 2022-12-01 at 07:10 -0800, Freedom K wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Freedom K

unread,
Dec 2, 2022, 4:50:09 AM12/2/22
to CAS Community, Ray Bon
Thank you Ray.
I will try it (in thelog4j2.xml?) and see if more information will be visible.
If this is a spring config issue, can we use a bigger version of spring for the cas version 5.2.9?
I see that the versions in the pom.xml is
        <springboot.version>1.5.14.RELEASE</springboot.version>
        <spring.version>4.3.17.RELEASE</spring.version>

Freedom K

unread,
Dec 2, 2022, 10:49:33 AM12/2/22
to CAS Community, Freedom K, Ray Bon
Hi everyone,
The issue with the configs seem to appear when we "seperate" the cas.authn.pac4j.saml[0] configs in different config files

For example all the configs of the type cas.authn.pac4j.saml[0]  that we use in cas are the below:
cas.authn.pac4j.saml[0].keystorePassword=pac4j-demo-passwd
cas.authn.pac4j.saml[0].privateKeyPassword=pac4j-demo-passwd
cas.authn.pac4j.saml[0].serviceProviderEntityId=urn:mace:saml:pac4j.org
cas.authn.pac4j.saml[0].serviceProviderMetadataPath=/etc/cas/config/sp-metadata.xml
cas.authn.pac4j.saml[0].keystorePath=/etc/cas/config/samlKeystore.jks
cas.authn.pac4j.saml[0].identityProviderMetadataPath=https://blablabla
cas.authn.pac4j.saml[0].clientName=SAML2Client

When we set up e.g. cas.authn.pac4j.saml[0].identityProviderMetadataPath in the file conf/cas_custom.properties and all the rest in the file conf/cas_base.properties, then the login does not work correctly.
However, when we set up ALL the used cas.authn.pac4j.saml[0]  configs in the config file (either cas_custom.properties or/and cas_base.properties) then the login is working as expected.
So it looks like those kind of configs need to be read from the same file all together, else if they are read partially from different files, something is not working as expected.
I am not sure if this kind of issue can happen in different config types as well.

Thanks,
Ria
Reply all
Reply to author
Forward
0 new messages