Thanks!  That is really odd.  I tried that earlier but couldn't get it to 
work so I just reverted to storing it in the classpath.  Maybe I just 
messed something up though when I was testing as I am testing a lot of 
things that are new to me as I try to update my very old CAS 3.x to 5.1.3.  
More odd is that I don't have the dependency added in my pom.xml file, I 
only set cas.serviceRegistry.initFromJson=true and that was enough to have 
my service definition read from the classpath;/services directory.

On Tuesday, September 5, 2017 at 11:19:32 PM UTC+8, David Curry wrote:
>
> You're mixing two different things. The bug fix (more of a feature 
> enhancement) you describe was to the automatic service registry 
> initialization feature described here: 
> https://apereo.github.io/cas/development/installation/InMemory-Service-Management.html#auto-initialization
>  
> <https://www.google.com/url?q=https%3A%2F%2Fapereo.github.io%2Fcas%2Fdevelopment%2Finstallation%2FInMemory-Service-Management.html%23auto-initialization&sa=D&sntz=1&usg=AFQjCNEzU12Ry5xghNB4LpmwDRjQ2frs2A>
>
> That's not (at least as I understand it) the same thing as the JSON 
> service registry itself, which is added with a separate dependency as I 
> described (although it probably gives you the same result).
>
> Adding the dependency to pom.xml:
>
> <dependency>
>     <groupId>org.apereo.cas</groupId>
>     <artifactId>cas-server-support-json-service-registry</artifactId>
>     <version>${cas.version}</version>
> </dependency>
>
>
> and re-running mvnw clean package, and then adding 
>
> cas.serviceRegistry.config.location:    file:/etc/cas/services
>
>
> to cas.properties and then making a service description like this in 
> /etc/cas/services/wildcard.json (or whatever):
>
> {
>   /*
>    * Wildcard service definition that applies to any https or imaps url.
>    * Do not use this definition in a production environment.
>    */
>   "@class" :            "org.apereo.cas.services.RegexRegisteredService",
>   "serviceId" :         "^(https|imaps)://.*",
>   "name" :              "HTTPS/IMAPS wildcard",
>   "id" :                20170905111650,
>   "evaluationOrder" :   99999
> }
>
>
> should work. Don't forget to restart the server. :-)
>
> At least, it works just fine for me on CAS 5.1.3. When the CAS login page 
> is displayed, you should see whatever string is in the name field of the 
> JSON displayed at the top right of the page in a light blue box. That's how 
> you know which registry entry matched.
>
> --Dave
>
>
>
>
>
>
> --
>
> DAVID A. CURRY, CISSP
> *DIRECTOR OF INFORMATION SECURITY*
> INFORMATION TECHNOLOGY
>
> 71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
> +1 212 229-5300 x4728 • [email protected] <javascript:>
>
> [image: The New School]
>
> On Tue, Sep 5, 2017 at 10:55 AM, Doug C <[email protected] 
> <javascript:>> wrote:
>
>> Actually, when I did that, it did not work.  This appears to be a bug 
>> that has been fixed in CAS 5.2.0 RC2 as mentioned at 
>> https://apereo.github.io/2017/08/04/520rc2-release/#minors.
>>
>> "Service registry initialization from JSON is now able to honor service 
>> definitions found at the path specified via settings, rather than only 
>> loading those found on the classpath’s services directory."
>>
>>
>>
>> On Tuesday, September 5, 2017 at 8:11:59 PM UTC+8, David Curry wrote:
>>
>>> To use a separate JSON registry (e.g., /etc/cas/services/), you have to 
>>> add the
>>>
>>> cas-server-support-json-service-registry
>>>
>>>
>>> dependency to pom.xml and rebuild the server. Then you can set
>>>
>>> cas.serviceRegistry.config.location:    file:/etc/cas/services
>>>
>>>
>>> and put your service declarations in there.
>>>
>>> See 
>>> https://apereo.github.io/cas/5.1.x/installation/JSON-Service-Management.html
>>>  
>>> for the full documentation.
>>>
>>> --Dave
>>>
>>>
>>> --
>>>
>>> DAVID A. CURRY, CISSP
>>> *DIRECTOR OF INFORMATION SECURITY*
>>> INFORMATION TECHNOLOGY
>>>
>>> 71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
>>> +1 212 229-5300 x4728 • [email protected]
>>>
>>> [image: The New School]
>>>
>>> On Tue, Sep 5, 2017 at 7:47 AM, Doug C <[email protected]> wrote:
>>>
>>>> I had this happen as well.  I fixed it by adding the following line to 
>>>> the overlay etc/cas/config/cas.properties file:
>>>>
>>>> cas.serviceRegistry.initFromJson=true
>>>>
>>>> This seemed to cause the default service registry description files to 
>>>> be read in but they only allow HTTPS and IMAPS services.  So in addition I 
>>>> also created the following directory structure in the overlay:  
>>>> src/main/webapp/WEB-INF/classes/services/ and then added a file named 
>>>> HTTP-10000003.json with the following content:
>>>>
>>>> {
>>>>   /*
>>>>     Generic service definition that applies to http urls
>>>>     that wish to register with CAS for authentication.
>>>>   */
>>>>   "@class" : "org.apereo.cas.services.RegexRegisteredService",
>>>>   "serviceId" : "^http://.*";,
>>>>   "name" : "HTTP",
>>>>   "id" : 10000003,
>>>> }
>>>>
>>>> By adding this extra service definition I was also able to use CAS with 
>>>> my HTTP urls as well.
>>>>
>>>> Note:  I also tried to set 
>>>> cas.serviceRegistry.config.location=file:/etc/cas/services in the 
>>>> cas.properties file and then place the new service definition file there 
>>>> but it never seemed to want to read it.  I think I did stumble across one 
>>>> bug report that indicated that setting it to anything besides 
>>>> classpath:/services wasn't working but that it was fixed in the v5.2.0.
>>>>
>>>> -- 
>>>> - Website: https://apereo.github.io/cas
>>>> - Gitter Chatroom: https://gitter.im/apereo/cas
>>>> - List Guidelines: https://goo.gl/1VRrw7
>>>> - Contributions: https://goo.gl/mh7qDG
>>>> --- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "CAS Community" 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-user/1e82ca7c-aecf-4940-8f33-072857afed7a%40apereo.org
>>>>  
>>>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/1e82ca7c-aecf-4940-8f33-072857afed7a%40apereo.org?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>> -- 
>> - Website: https://apereo.github.io/cas
>> - Gitter Chatroom: https://gitter.im/apereo/cas
>> - List Guidelines: https://goo.gl/1VRrw7
>> - Contributions: https://goo.gl/mh7qDG
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "CAS Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/d550fcb5-efa4-4720-99bf-5a0e88184da5%40apereo.org
>>  
>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/d550fcb5-efa4-4720-99bf-5a0e88184da5%40apereo.org?utm_medium=email&utm_source=footer>
>> .
>>
>
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" 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-user/6053c77b-108d-4466-a322-96f9980fc14d%40apereo.org.

Reply via email to