Yes, findServiceBy will match against the serviceId regexes. It does depend on each service having "non-overlapping" regexes, but I think this is a Service Registry requirement anyway.
The issue I have is working with a set of services on machines in a load balanced cluster. In addition to logging in to the services through a common, load-balanced URL (e.g.
https://company.com/service), I want to be able to log in to each service on each machine by machine name (e.g.
https://machine1/service). The problem is the services aren't currently smart enough to dynamically determine their service path (using either machine name or common URL). They always use the common URL.
So I can initiate a load-balanced login with,
Or a machine-specific service login with,
but the service passed to the CAS ticket validation URL will always be
The problem is, CAS issues the service ticket tied to the value passed in to /cas/login. Since the DefaultServiceMatchingStrategy does a case-insensitive string compare, the service ticket check fails when using the machine name service.
On the other hand, if I switch the ServiceMatchingStrategy to use ServicesManager.findServiceBy (serviceId), I can configure each serviceId regex in the Service Registry to have both paths (
company.com|machine1).
This seems to work, but I was just wondering if there were any gotchas.
Thanks!
-Brent Smith