apereo/cas · warning

No registered service is found to match

Error message

No registered service is found to match [{}] or access is denied. Using default theme [{}]

What it means

RegisteredServiceThemeResolver.resolveThemeName looks up the registered service matching the request's service parameter via ServicesManager. If no registered service matches, or the service's access strategy denies access, the resolver logs this warning and falls back to the default theme instead of the service-specific theme.

Solutions

  1. Register (or enable) a service definition whose serviceId pattern matches the incoming service URL.
  2. Inspect the matched service's access strategy and re-enable access or authorize the caller.
  3. Confirm the service registry is loaded/synchronized on this CAS node.
  4. Verify the service parameter in the request URL matches the serviceId regex exactly.

Example fix

// before: service disabled
"accessStrategy": { "@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy", "enabled": false }
// after
"accessStrategy": { "@class": "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy", "enabled": true, "ssoEnabled": true }
Defensive patterns

Strategy: validation

Validate before calling

// verify service resolves and access is allowed before expecting a custom theme
RegisteredService svc = servicesManager.findServiceBy(serviceUrl);
if (svc == null) throw new IllegalStateException("No service registered for " + serviceUrl);
if (!((WebBasedRegisteredService) svc).getAccessStrategy().isServiceAccessAllowed(svc, serviceUrl))
    throw new IllegalStateException("Access denied for " + svc.getName());

Prevention

When it happens

Trigger: A request arrives with a service parameter that does not match any registered service in the registry, or matches one whose RegisteredServiceAccessStrategy.isServiceAccessAllowed() returns false (service disabled, expired, unauthorized caller, etc.).

Common situations: Service not yet registered/loaded in the service registry; service registry file/repo not replicated to this node; service marked disabled or unauthorized by access strategy; caller IP/URL pattern excluded by the service's access strategy.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of apereo/cas@e7288fc434 (2026-09-08). Data as JSON: /api/errors/7398330ebdbf2463. Report an issue: GitHub.

Appendix: source

Thrown at support/cas-server-support-themes-core/src/main/java/org/apereo/cas/services/web/RegisteredServiceThemeResolver.java:83

    protected final ObjectProvider<AuthenticationServiceSelectionPlan> authenticationRequestServiceSelectionStrategies;

    protected final ObjectProvider<CasConfigurationProperties> casProperties;

    @NonNull
    @Override
    public String resolveThemeName(final HttpServletRequest request) {
        val context = RequestContextHolder.getRequestContext();
        val serviceContext = WebUtils.getService(context);
        val service = FunctionUtils.doUnchecked(() -> authenticationRequestServiceSelectionStrategies.getObject().resolveService(serviceContext));
        if (service == null) {
            LOGGER.trace("No service is found in the request context. Falling back to the default theme [{}]", getDefaultThemeName());
            return rememberThemeName(request);
        }

        val registeredService = (WebBasedRegisteredService) servicesManager.getObject().findServiceBy(service);
        if (registeredService == null || !registeredService.getAccessStrategy().isServiceAccessAllowed(registeredService, service)) {
            LOGGER.warn("No registered service is found to match [{}] or access is denied. Using default theme [{}]", service, getDefaultThemeName());
            return rememberThemeName(request);
        }
        if (StringUtils.isBlank(registeredService.getTheme())) {
            LOGGER.trace("No theme name is specified for service [{}]. Using default theme [{}]", registeredService, getDefaultThemeName());
            return rememberThemeName(request);
        }

        val themeName = determineThemeNameToChoose(request, service, registeredService);
        return rememberThemeName(request, themeName);
    }
    
    protected String determineThemeNameToChoose(final HttpServletRequest request,
                                                final Service service,
                                                final WebBasedRegisteredService registeredService) {
        HttpResponse response = null;
        try {
            LOGGER.debug("Service [{}] is configured to use a custom theme [{}]", registeredService, registeredService.getTheme());

View on GitHub (pinned to e7288fc434)