I would like to try and play with attribute resolution so that I can go with the absolute minimum configuration. But right now, with the attribute caching on, I have to restart the CAS server every time, which is a seriously painful and long process. So,
following this doc...
https://apereo.github.io/cas/5.2.x/integration/Attribute-Release-Caching.html
And putting in...
"attributeReleasePolicy" : { "@class" : "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy", "principalAttributesRepository" : { "@class" : "org.apereo.cas.authentication.principal.cache.CachingPrincipalAttributesRepository", "duration" : { "@class" : "javax.cache.expiry.Duration", "timeUnit" : [ "java.util.concurrent.TimeUnit", "MILLISECONDS" ], "expiration" : 1 }, "mergingStrategy" : "NONE" } }
I find that the attributes are still caching. if I mess up the attribute resolver configuration I still get the previously and properly resolved attributes when I should not. My logs show it was indeed cached.
2018-07-12 15:54:00,854 DEBUG [org.apereo.services.persondir.support.AttributeBasedCacheKeyGenerator] - <Generated cache Map {username=[trenta]} from seed Map {username=[trenta]}>
2018-07-12 15:54:00,854 DEBUG [org.apereo.services.persondir.support.AttributeBasedCacheKeyGenerator] - <Generated cache key '1010926425|1010941093' for MethodInvocation='org.apereo.services.persondir.support.CachingPersonAttributeDaoImpl$PersonAttributeDaoMethodInvocation@21ec9ffd'>
2018-07-12 15:54:00,855 DEBUG [org.apereo.services.persondir.support.CachingPersonAttributeDaoImpl] - <Retrieved query from cache for scopedTarget.attributeRepository. key='1010926425|1010941093', results='[NamedPersonImpl[name=trenta,attributes={UDC_IDENTIFIER=[E8E48327C10F67B9E0430100007F1073],
uid=[trenta], commonName=[Trenton Adams]}]]'>
2018-07-12 15:54:00,855 DEBUG [org.apereo.services.persondir.support.CachingPersonAttributeDaoImpl.statistics] - <Cache Stats scopedTarget.attributeRepository: queries=4, hits=3, misses=1>
2018-07-12 15:54:00,855 DEBUG [org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository] - <Found [3] attributes for principal [trenta] from the attribute repository.>
2018-07-12 15:54:00,856 DEBUG [org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository] - <No merging strategy found, so attributes retrieved from the repository will be used instead.>
2018-07-12 15:54:00,856 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Found principal attributes [{commonName=Trenton Adams, uid=trenta, UDC_IDENTIFIER=E8E48327C10F67B9E0430100007F1073}] for [trenta]>
2018-07-12 15:54:00,857 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Calling attribute policy [ReturnAllowedAttributeReleasePolicy] to process attributes for [trenta]>
2018-07-12 15:54:00,857 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Attribute policy [ReturnAllowedAttributeReleasePolicy] allows release of [{}] for [trenta]>
2018-07-12 15:54:00,857 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Attempting to merge policy attributes and default attributes>
2018-07-12 15:54:00,857 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Checking default attribute policy attributes>
2018-07-12 15:54:00,858 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Located application context. Retrieving default attributes for release, if any>
2018-07-12 15:54:00,858 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Default attributes for release are: [[uid, UDC_IDENTIFIER]]>
2018-07-12 15:54:00,858 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Found and added default attribute for release: [uid]>
2018-07-12 15:54:00,858 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Found and added default attribute for release: [UDC_IDENTIFIER]>
2018-07-12 15:54:00,858 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Default attributes found to be released are [{UDC_IDENTIFIER=blah, uid=trenta}]>
So, how exactly do I get this to stop caching?
-- Trenton D. Adams Senior Systems Analyst/Web Software Developer Applications Unit - ITS Athabasca University (780) 675-6195 It is only when you are surrounded by a supportive team, that you can achieve your best. Instead of tearing people down, try building them up!--
This communication is intended for the use of the recipient to whom it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communications received in error, or subsequent reply, should be deleted or destroyed.---
-- Ray Bon Programmer analyst Development Services, University Systems 2507218831 | CLE 019 | rb...@uvic.ca
Interesting. I'm not at the stage where I'm deploying to a server yet; I'm just assessing features and how they work. I just find the cas restart times to be huge. Maybe the "./build.sh run" is the culprit of it taking so long, I should try and deploy
to my own tomcat.
--
- 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+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/1531433431.2758.50.camel%40uvic.ca.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/4554a5b1-4889-3034-88cf-47a91be98fed%40athabascau.ca.