attributeRepository.expireInMinutes, maximumCacheSize and merger is never taken into account

112 views
Skip to first unread message

Anthony O.

unread,
Feb 7, 2018, 6:49:29 AM2/7/18
to CAS Community
Hello,

I'm trying to disable the cache of my cas.authn.attributeRepository in order for the cas.authn.attributeRepository.jdbc to retrieve the attributes each time a user logs in and want the "merger" strategy to be "MERGE".

So in my /etc/cas/config/cas.properties I've set the following lines:
cas.authn.attributeRepository.expireInMinutes=0
cas.authn.attributeRepository.maximumCacheSize=0
cas.authn.attributeRepository.merger=MERGE

I have set the same lines in /etc/cas/config/application.yml .

After setting a breakpoint on org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties#getExpireInMinutes as well as the set method: when the get method is called (just before com.github.benmanes.caffeine.cache.Caffeine#expireAfterWrite ), the field is always set with the default int 30.

I've checked also the 2 other fields, they are not set with what I set in my configuration files... I also define cas.authn.attributeRepository.jdbc[0] parameters which are taken into account (so that is not a settings file location problem)...

Is this a bug or I'm not using the right properties name for disabling the attributeRepository cache resolution?

I've tried this with CAS v5.2.1 & 5.2.2 with the same results.

Thank you for your help!

Man H

unread,
Feb 7, 2018, 8:30:20 AM2/7/18
to cas-...@apereo.org
cas.authn.attributeRepository.expirationTime

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/dfefc824-c82f-4683-bcf5-3078af88cf04%40apereo.org.

Anthony O.

unread,
Feb 7, 2018, 8:35:56 AM2/7/18
to CAS Community
Thank you for this help Manfredo but as I said, I'm using CAS v5.2.1 & 5.2.2 and this configuration parameter does not exist in this version : https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html

Moreover, the cas.authn.attributeRepository.merger is the same, and my "MERGE" value is not taken into account anyways (I can see that by using a breakpoint on org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties#getMerger, debugging my CAS server).
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

Man H

unread,
Feb 7, 2018, 8:37:26 AM2/7/18
to cas-...@apereo.org
Why do you have application yml and cas properties 


El miércoles, 7 de febrero de 2018, Anthony O. <aog...@iorga.com> escribió:
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

Man H

unread,
Feb 7, 2018, 8:47:22 AM2/7/18
to cas-...@apereo.org
Do you have other attribute sources 


If multiple attribute repository sources are defined, they are added into a list and their results are cached and merged.

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/f30a327b-f226-4e71-b072-4c3dad0df107%40apereo.org.

Anthony O.

unread,
Feb 7, 2018, 9:11:30 AM2/7/18
to CAS Community
I was just testing if this was caused because I was using application.yml so I added the same values in cas.properties just to see (both are failing).

I don't have other attribute sources I think... what properties would involve other attribute sources? The documentation is not clear about the CAS Attributes flow, from where the attributes are searched, which configuration properties filter them and why I finally don't have my attributes in my authenticated user... I have found that the only good documentation is to debug by myself and point some breakpoints and analyze variables values :/

And here I saw that cas.authn.attributeRepository.jdbc[0] is correctly read from my configuration, but not cas.authn.attributeRepository.merger or the other 2 parameters...

Man H

unread,
Feb 7, 2018, 9:34:05 AM2/7/18
to cas-...@apereo.org
Could you debug org.apereo.cas.configuration.CasConfigurationProperties where all properties are loaded. 

Also see from startup log which file properties are fetched 
Also set debug mode
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/48e6208d-98d3-48e3-885d-ae697f9845b6%40apereo.org.

Man H

unread,
Feb 7, 2018, 4:01:05 PM2/7/18
to cas-...@apereo.org
Here you see debug for expration set:

ntingTicketImpl,prefix=TGT]]>
2018-02-07 17:49:37,322 DEBUG [org.apereo.cas.config.CasCoreTicketsSchedulingConfiguration] - <Ticket registry cleaner is enabled.>
2018-02-07 17:49:37,673 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured merging strategy for attribute sources is [MERGE]>
2018-02-07 17:49:37,679 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured single-row JDBC attribute repository for [jdbc:mysql://localhost:3306/intranet]>
2018-02-07 17:49:37,686 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured multi-row JDBC attribute repository for [jdbc:mysql://localhost:3306/intranet]>
2018-02-07 17:49:37,690 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured multi-row JDBC column mappings for [jdbc:mysql://localhost:3306/intranet] are [{roles=aplicrol}]>
2018-02-07 17:49:37,707 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Final list of attribute repositories is [[org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao@1449c2af, org.apereo.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao@4dcf82b3]]>
2018-02-07 17:49:37,709 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured attribute repository sources to merge together: [[org.apereo.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao@1449c2af, org.apereo.services.persondir.support.jdbc.MultiRowJdbcPersonAttributeDao@4dcf82b3]]>
2018-02-07 17:49:37,773 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured cache expiration policy for merging attribute sources to be [0] minute(s)>


Also set debug mode

Anthony O.

unread,
Feb 20, 2018, 10:57:51 AM2/20/18
to CAS Community
Thank you for your hints Manfredo, I finally managed to spot the problem: I was deploying CAS inside a Docker container which was not redeploying my modification on my application.yml file!
When I modified this file inside my container, the cas.authn.attributeRepository.* attributes were correctly taken into account by CAS.

Regards,
 Anthony
Reply all
Reply to author
Forward
0 new messages