JSON Service Registry cas.serviceRegistry.config.location property setting ineffective after upgrading to CAS version 5.2

3,172 views
Skip to first unread message

crdaudt

unread,
Dec 18, 2017, 3:37:16 PM12/18/17
to CAS Community
I updated my test sever from CAS v5.1.4 to v5.2.0, and my configruation is no longer reading my *.json files from my external file location.  Here are my relevant property settings:

#========================================
# Service Registry
#========================================
cas.serviceRegistry.watcherEnabled=true
cas.serviceRegistry.initFromJson=true
cas.serviceRegistry.config.location=file:///etc/cas/services

I have the following dependency set in pom.xml:

 <dependency>
   <groupId>org.apereo.cas</groupId>
   <artifactId>cas-server-support-json-service-registry</artifactId>
   <version>${cas.version}</version>
</dependency>

The /etc/cas/services/ directory and json files within it are owned by tomcat.

Nevertheless, the only services loaded are the *.json files located in classpath:/services.  On the other hand, if I redeploy the cas.war file for v5.1.4 and restart tomcat, my JSON files in /etc/cas/services are loaded as I would expect.

Any ideas?

I have attached copies of my cas.log (with debug enabled), pom.xml, and cas.properties.  Thanks in advance for any help with this.

pom.xml
cas.properties
cas.log_52.log

David Curry

unread,
Dec 18, 2017, 3:50:22 PM12/18/17
to cas-...@apereo.org
You have the wrong property name (I forget when it changed).

cas.serviceRegistry.json.location: file:/etc/cas/services

Also, since you have your own non-empty service registry, you should have

cas.serviceRegistry.initFromJson: false

That property tells the CAS server to load an otherwise empty service registry (like the default one in memory) from the JSON files it comes bundled with (the wildcard-y ones stored in the classpath). You don't want/need to do that anymore, so false is the right setting.

--Dave



--

DAVID A. CURRY, CISSP
DIRECTOR OF INFORMATION SECURITY
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728david...@newschool.edu

The New School


--
- 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 cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/d388f5f9-6e3f-4ce3-bdca-dd71356b6c35%40apereo.org.

crdaudt

unread,
Dec 19, 2017, 2:14:39 PM12/19/17
to CAS Community
Using cas.serviceRegistry.json.location instead of cas.serviceRegistry.config.location solved my issue.  Apparently this changed between 5.1.x and 5.2.0.  Once again, thanks Dave for working me through this.

About your second comment, I noticed that if I set cas.serviceRegistry.initFromJson to false, two json files are automatically created for me when CAS starts up, Apereo-10000002.json and HTTPSandIMAPS-10000001.json with default values.  How can this be avoided?

Just to reiterate:  My primary issue has been resolved.




On Monday, December 18, 2017 at 3:50:22 PM UTC-5, David Curry wrote:
You have the wrong property name (I forget when it changed).

cas.serviceRegistry.json.location: file:/etc/cas/services

Also, since you have your own non-empty service registry, you should have

cas.serviceRegistry.initFromJson: false

That property tells the CAS server to load an otherwise empty service registry (like the default one in memory) from the JSON files it comes bundled with (the wildcard-y ones stored in the classpath). You don't want/need to do that anymore, so false is the right setting.

--Dave

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

David Curry

unread,
Dec 19, 2017, 2:38:40 PM12/19/17
to cas-...@apereo.org
I noticed that if I set cas.serviceRegistry.initFromJson to false, two json files are automatically created for me when CAS starts up, Apereo-10000002.json and HTTPSandIMAPS-10000001.json with default values.  How can this be avoided?

I recall this came up on the list a while back, so you might search the Google Group for it.

It's behavior that I've personally never seen, so I have no good answer for you.

--Dave


--

DAVID A. CURRY, CISSP
DIRECTOR OF INFORMATION SECURITY
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728david...@newschool.edu

The New School


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/16a4539d-c963-4115-9c69-1a0cfc12e651%40apereo.org.

IOTech Co., Ltd

unread,
Apr 21, 2018, 9:24:46 AM4/21/18
to CAS Community
please help me :

#========================================
# Service Registry
#========================================
cas.serviceRegistry.watcherEnabled=true
cas.serviceRegistry.repeatInterval=120000
cas.serviceRegistry.startDelay=15000
cas.serviceRegistry.initFromJson=false
cas.serviceRegistry.config.location=file:/etc/cas/services

serviceTicket ST-1-5b-doeKww5fM0PDeSvpMPGxk2ak-longtran
200
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationSuccess>
        <cas:user>admin</cas:user>
        </cas:authenticationSuccess>
</cas:serviceResponse>



Vào 03:37:16 UTC+7 Thứ Ba, ngày 19 tháng 12 năm 2017, crdaudt đã viết:

IOTech Co., Ltd

unread,
Apr 21, 2018, 9:26:48 AM4/21/18
to CAS Community
I updated my test sever from CAS v5.1.4 to v5.2.0, and my configruation is no longer reading my *.json files from my external file location.

Vào 20:24:46 UTC+7 Thứ Bảy, ngày 21 tháng 4 năm 2018, IOTech Co., Ltd đã viết:

David Curry

unread,
Apr 21, 2018, 9:59:14 AM4/21/18
to cas-...@apereo.org
This was answered earlier in this thread. You have the wrong property name. It changed between 5.1 and 5.2 to:

cas.serviceRegistry.json.location: file:/etc/cas/services

If you're moving from one version to another, I strongly recommend carefully reading the "ChangeLog" blog posts that Misagh writes for every release candidate before you start. He's pretty good at documenting all the changes, especially the ones that might cause an older configuration to break.

Go here: https://github.com/apereo/cas/releases/tag/v5.2.0 and click on "RC1," "RC2," "RC3," and "RC4" (the change above is documented in "RC2").

--Dave


--

DAVID A. CURRY, CISSP
DIRECTOR OF INFORMATION SECURITY
INFORMATION TECHNOLOGY

71 FIFTH AVE., 9TH FL., NEW YORK, NY 10003
+1 212 229-5300 x4728david...@newschool.edu

The New School


--
- 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 cas-user+unsubscribe@apereo.org.

IOTech Co., Ltd

unread,
Apr 21, 2018, 1:14:09 PM4/21/18
to cas-...@apereo.org
i has config as below...but it not work, please help me


cas.serviceRegistry.location=file:/etc/cas/services


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

--
- 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 cas-user+unsubscribe@apereo.org.

IOTech Co., Ltd

unread,
Apr 21, 2018, 1:14:32 PM4/21/18
to cas-...@apereo.org
{
"@class" : "org.apereo.cas.services.RegexRegisteredService",
"serviceId" : "^(https|imaps|http)://.*",
"name" : "HTTPSandIMAPS",
"id" : 1039356577441984,
"description" : "This service definition authorizes all application urls that support HTTPS and IMAPS protocols.",
"evaluationOrder" : 1,
"accessStrategy" : {
"@class" : "org.apereo.cas.grouper.services.GrouperRegisteredServiceAccessStrategy",
"enabled" : true,
"ssoEnabled" : true,
"requireAllAttributes" : true,
"requiredAttributes" : {
"@class" : "java.util.HashMap",
"grouperAttributes" : [ "java.util.HashSet", [ "faculty" ] ]
},
"groupField" : "DISPLAY_EXTENSION"
}
}


David Curry

unread,
Apr 21, 2018, 2:07:40 PM4/21/18
to cas-...@apereo.org
cas.serviceRegistry.json.location



David A. Curry,  CISSP
Director of Information Security
The New School - Information Technology
71 Fifth Ave., 9th Fl. ~ New York, NY 10003
+1 212 229-5300 x4728david...@newschool.edu
Sent from my phone; please excuse typos and inane auto-corrections.
   

--
- 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 cas-user+u...@apereo.org.

IOTech Co., Ltd

unread,
Apr 21, 2018, 9:44:17 PM4/21/18
to cas-...@apereo.org
i have got error...please help me on this bug. Thanks

Unauthorized Service Access. Service [https://cas01.example.org:8443/cas] is not found in service registry.

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

--
- 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 cas-user+unsubscribe@apereo.org.

--
- 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 cas-user+unsubscribe@apereo.org.

--
- 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 cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CA%2Bd9XANVzd7rJ6o8jfMU6Wtt3TCRNm5WB%2BcZAAqRSJUSAFKmiA%40mail.gmail.com.

William E.

unread,
Apr 22, 2018, 11:46:21 PM4/22/18
to CAS Community
Your service provided in this thread:

"serviceId" : "^(https|imaps|http)://.*"

Will not match with a port specified.  Try instead:

"serviceId" : "^(https|imaps|http)://.*:8443/.*"

-W
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

--
- 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 cas-user+u...@apereo.org.

--
- 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 cas-user+u...@apereo.org.

--
- 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 cas-user+u...@apereo.org.
Reply all
Reply to author
Forward
0 new messages