Bug in ServicesManager cache (since 6.3)

64 views
Skip to first unread message

antoine m

unread,
Oct 22, 2021, 5:52:20 AM10/22/21
to CAS Developer
Hi,

I think there is a bug in the ServicesManager cache feature since version 6.3.

If i disable the automatic reload of services (cas.service-registry.schedule.enabled: false), the cache expire after 15mn (by default) and the cache is empty.

I can reproduce the problem in Oauth2 protocol : after 15mn, CAS fail to authorize any  legitimate service.
The  method servicesManager.getAllServicesOfType(OAuthRegisteredService.class) always return an empty collection because it query only the cache and not the ServiceRegistry source.

Regards,
Antoine

Misagh

unread,
Oct 22, 2021, 6:18:53 AM10/22/21
to CAS Developer
Can you put together a test case that demonstrates the problem?
> --
> You received this message because you are subscribed to the Google Groups "CAS Developer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cas-dev+u...@apereo.org.
> To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-dev/07dd6859-df67-4c86-a8fd-327514093179n%40apereo.org.

antoine m

unread,
Oct 22, 2021, 6:57:10 AM10/22/21
to CAS Developer, Misagh Moayyed
  • application.yaml :
cas.service-registry.json.location: file:/etc/cas/config/services
cas.service-registry.json.watcher-enabled: false
cas.service-registry.schedule.enabled: false

  • First request 


in the log :
2021-10-22 12:39:34,205 DEBUG [org.apereo.cas.support.oauth.validator.authorization.BaseOAuth20AuthorizationRequestValidator] - <Locating registered service for client id [oidc-authorization-code]>

  • 15mn later, same test
=> HTTP 401 Access Denied

in the log :
2021-10-22 12:54:19,208 WARN [org.apereo.cas.support.oauth.validator.authorization.BaseOAuth20AuthorizationRequestValidator] - <Registered service [oidc-authorization-code] is not found or is not authorized for access.>
Reply all
Reply to author
Forward
0 new messages