Hi Marcus,
If you are using 5.0.x or later , there should be a
requiredAttributes field mentioned in the doc "
https://apereo.github.io/cas/5.1.x/installation/Configuring-Service-Access-Strategy.html".
You will need to group all your users that need the restriction to the same service, then do something like below:
MyService-101.json
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "https://this-is-your-site.example.com",
"name" : "My Service",
"id" : 101,
"accessStrategy" : {
"@class" : "org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy",
"enabled" : true,
"requireAllAttributes" : false,
"ssoEnabled" : true,
"requiredAttributes" : {
"@class" : "java.util.HashMap",
"requiredAttributeHere1" : [ "java.util.HashSet", [ ".+" ] ],"requiredAttribute2" : [ "java.util.HashSet", [ ".+" ] ],
}
}
}
Note: those restriction are regex supported, that's why I use .+.
Then route the user to the service like this:
https://sso.cas.mycas?service=https%3A%2F%2Fthis-is-your-site.example.comWhen user attempt to login, the restriction of attribute should triggered.
Is this the kind of behavior you want to implement?
-Andy