I have solved this in my deployment by having three different
ServicesManagers that are chained.  One that is CAS only services, one that
is OAuth services and one that is SAML services.  Using the supports()
methods to control how a service is selected.  The CAS only uses the
friendlyName match to RegexRegisteredService, so having a
CasRegisteredService would simplify that to an instanceof check.

Travis

On Mon, Jun 7, 2021 at 1:07 AM Jérôme LELEU <[email protected]> wrote:

> Hi,
>
> I have this SAML SP definition in CAS:
>
> {
>   "@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService",
>   "serviceId" : "http://localhost:8081.*";,
>   "name" : "SAMLService",
>   "id" : 1,
>   "evaluationOrder" : 1,
>   "metadataLocation" : 
> "/Users/jleleu/sources/spring-webmvc-pac4j-boot-demo/sp-metadata.xml"
> }
>
>
> And I have realized that I can log in using the CAS protocol with the same
> service definition :
>
>
> http://localhost:8080/cas/login?service=http%3A%2F%2Flocalhost%3A8081%2Fcallback%3Fclient_name%3DCasClient
>
> I would have expected the SAML definition not to work for the CAS protocol.
>
> More generally, I have the feeling that protocols are not sufficiently
> differentiated in CAS.
> I'm thinking about the SamlIdPSingleLogoutServiceMessageHandler and the
> DefaultSingleLogoutServiceMessageHandler components although there might
> be better examples.
>
> We have built the SAML, OAuth and OIDC protocols on top of the CAS
> protocol while CAS should be somehow alongside the other protocols.
>
> In terms of design, as a first step, I would make RegexRegisteredService an
> abstract class and create a *CasRegisteredService* (inheriting from it)
> like we have a SamlRegisteredService, a OAuthRegisteredService...
>
> This may be a huge change better targeted at v6.5 or even v7.
>
> Does it make sense?
>
> Thanks.
> Best regards,
> Jérôme
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/a/apereo.org/d/msgid/cas-dev/CAP279LzNmaCyk1f_ugJRcQbTappYN8zkKZnw6YAfYdyJZpK7HA%40mail.gmail.com
> <https://groups.google.com/a/apereo.org/d/msgid/cas-dev/CAP279LzNmaCyk1f_ugJRcQbTappYN8zkKZnw6YAfYdyJZpK7HA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-dev/CAC_RtEaqf3adh1QM4La7wVY%2Bpx8%2BVW65MT3M9-cALrwebCp3xw%40mail.gmail.com.

Reply via email to