Because we really do not want to have any part in administrating service definitions for individual SPs of a federation. On the contrary, we want out users to be able to access all SPs belonging to HEAL-Link, or eduGAIN (or other federations) with the bare minimum configuration from our part (just setup the metadata providers and a general attribute release policy). What is certain is that we do not want to have to add a service definition every time someone in a Federation (eduGAIN is a Europe wide federation) adds a new service.
I tried a hack which seems to work. What I did is setup a service definition for each federation with a serviceId regular expression such as '.+' for the first, '..+' for the second and so on. EntityIDs are usually URLs so we can setup such regexps for a while. I also setup the evaluationOrder to be quite high.
For testing purposes I also setup a simpleSAMLPHP test SAML client with a service definition including a specific serviceId and an even higher evaluation order.
Example for eduGAIN:
{
"@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService",
"serviceId" : ".+",
"name" : "EDUGAIN",
"id" : 4001,
"evaluationOrder" : 10000,
"attributeReleasePolicy": {
"@class": "org.apereo.cas.services.ReturnAllAttributeReleasePolicy",
"consentPolicy": {
"@class": "org.apereo.cas.services.consent.DefaultRegisteredServiceConsentPolicy",
"status": "FALSE"
}
},
"metadataLocation" : "https://md.aai.grnet.gr/aggregates/edugain-metadata.xml"
}
Example for my specific SAML client:
{
"@class" : "org.apereo.cas.support.saml.services.SamlRegisteredService",
"serviceId" : "http://<my-site>:8080",
"name" : "SimpleSAMLPHP",
"id" : 4005,
"evaluationOrder" : 50000,
"attributeReleasePolicy": {
"@class": "org.apereo.cas.services.ReturnAllAttributeReleasePolicy",
"consentPolicy": {
"@class": "org.apereo.cas.services.consent.DefaultRegisteredServiceConsentPolicy",
"status": "FALSE"
}
},
"metadataLocation" : "http://<my-site>:8080/simplesaml/module.php/saml/sp/metadata.php/default-sp"
}
When I tried logging in, CAS "on demand" downloaded the metadata for all federations and my service (4 federations, one service):
# ls -lh /etc/cas/saml/metadata-backups/
total 105M
-rw-r----- 1 root root 1.3M Feb 23 14:33 33df1392ede2ae53cfbfda228c8c12795a487274.xml
-rw-r----- 1 root root 98M Feb 23 14:33 5aaa33456c18415a547a69c229b042939b5a69ee.xml
-rw-r----- 1 root root 1.9M Feb 23 14:32 cb375c9a62f6bfe288564021d6162a65d1a84137.xml
-rw-r----- 1 root root 3.9M Feb 23 14:33 f3394e69c8ae2f4476489e12d0309d11d21c4bfd.xml
-rw-r----- 1 root root 5.3K Feb 23 14:33 faca05ced5ea3197b309319bde338f587303682d.xml
Using a regex in the serviceId is mandatory so that CAS will download the metadata on demand.
A login test was successful, although CAS matched the serviceId belonging to the eduGAIN service definition:
sso-cas-overlay-sso-1 | 2024-02-23 15:26:08,303 DEBUG [org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade] - <Locating metadata for entityID [http://<my-site>:8080] by attempting to run through the metadata chain...>
sso-cas-overlay-sso-1 | 2024-02-23 15:26:08,303 DEBUG [org.apereo.cas.support.saml.services.idp.metadata.cache.SamlRegisteredServiceDefaultCachingMetadataResolver] - <Resolving metadata for [EDUGAIN] at [https://md.aai.grnet.gr/aggregates/edugain-metadata.xml]>
sso-cas-overlay-sso-1 | 2024-02-23 15:26:08,303 DEBUG [org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade] - <Resolved metadata chain from [https://md.aai.grnet.gr/aggregates/edugain-metadata.xml] using [org.opensaml.saml.metadata.resolver.ChainingMetadataResolver]. Filtering the chain by entity ID [http://<my-site>:8080]>
sso-cas-overlay-sso-1 | 2024-02-23 15:26:08,303 DEBUG [org.apereo.cas.support.saml.services.idp.metadata.SamlRegisteredServiceServiceProviderMetadataFacade] - <Located SP SSODescriptor in metadata for [http://<my-site>:8080]. Metadata is valid until [forever]>
So it seems that we can hack our way through, with the caveat that all federated services will end up to a single service definition and thus one attribute release policy/MFA policy etc.