configure CAS 6.1 to operate with another application

84 views
Skip to first unread message

ratm

unread,
Nov 5, 2019, 9:26:02 AM11/5/19
to CAS Community
Hello,

I'm trying to configure jenkins to use cas 6.1 for authentification with :


Under cas-overlay-template-6.1/etc/cas/services/

i have created jenkins-1.json file :

{
 
/*
     Service jenkins
  */

 
"@class" : "org.apereo.cas.services.RegexRegisteredService",
 
"serviceId" : "http://my-test-jenkins1.fr:8080/",
 
"name" : "Jenkins",
 
"id" : 1,
}


First the command :
 
 ./gradlew copyCasConfiguration

doesn't copy cas-overlay-template-6.1/etc/cas/services/jenkins-1.json under /etc/cas/services

But even if i manually copy cas-overlay-template-6.1/etc/cas/services/jenkins-1.json under /etc/cas/services when i run cas i have in log :
 <Loaded [0] service(s) from [InMemoryServiceRegistry].>


What's wrong ?

Thanks in advance for any help !

Best Regards,

Pol

unread,
Nov 5, 2019, 9:37:13 AM11/5/19
to cas-...@apereo.org
Hello,

Check your cas.properties file, it must contains:

cas.serviceRegistry.initFromJson=true
cas.service-registry.json.location=file:/etc/cas/services

You can have a look at this: https://github.com/crpeck/cas-overlay-docker it maybe might help you.

 -φol d.-
  Communications without intelligence is noise;
  Intelligence without communications is irrelevant.
  [Alfred M. Gray]


--
- 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.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/91d60102-c091-4668-a32c-0cb559f6cdc7%40apereo.org.

ratm

unread,
Nov 5, 2019, 10:47:18 AM11/5/19
to CAS Community
I have added

cas.service-registry.json.location=file:/etc/cas/services
cas
.serviceRegistry.initFromJson=true


to
cas.properties and put the everything-1.json into the directory /etc/cas/services

Problem is the same :

2019-11-05 16:34:51,426 INFO [org.apereo.cas.services.AbstractServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>


Ray Bon

unread,
Nov 5, 2019, 11:50:21 AM11/5/19
to cas-...@apereo.org
Anthony,

Verify that your properties are being read (simple approach is introduce a spelling mistake). Turn up logging to debug at least. Also check the tomcat settings logs. All available in catalina.out by default.

        <AsyncLogger name="org.apereo" level="${sys:cas.log.level}" includeLocation="true"/>

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

ratm

unread,
Nov 5, 2019, 12:06:18 PM11/5/19
to CAS Community
Thanks for help !

When i introduce an error on registry property application doesn't start !

Ray Bon

unread,
Nov 5, 2019, 1:18:21 PM11/5/19
to cas-...@apereo.org
Anthony,

Good. Properties are being read from where you expect them.
With the correct set of properties, is there anything in the logs that indicates where services are being read?

Ray

Andy Ng

unread,
Nov 6, 2019, 2:57:24 AM11/6/19
to CAS Community
Hi,



you can see the working mechaism of copyCasConfiguration:

...

task copyCasConfiguration(type: Copy, group: "build", description: "Copy the CAS configuration from this project to /etc/cas/config") {
    from "etc/cas/config"
    into new File('/etc/cas/config').absolutePath
    doFirst {
        new File('/etc/cas/config').mkdirs()
    }
}
...

Seems to me the main problem is that, copyCasConfiguration command does not copy /etc/cas/services, it just copy /etc/cas/config as show in the above code.

You will need to find other ways to copy the services... Or you can add your copy task as well so it can copy services for you :)

Cheers!
- Andy


ratm

unread,
Nov 6, 2019, 4:06:14 AM11/6/19
to CAS Community
Thanks for response and help !

I have many questions andsuggestions :
First (of all), i thinks it's better to explain in the readme.md that copyCasConfiguration only copy /cas-overlay-template-version/etc/cas/config into /etc/cas/config to avoid bad interpretation.
Secondly why copyCasConfiguration doesn't copy entire folder /cas-overlay-template-version/etc/cas/ into /etc/cas including thekeystore with eventually backup five old configuration ?

Best regards,
  Anthony

Andy Ng

unread,
Nov 6, 2019, 4:12:41 AM11/6/19
to CAS Community
Hi Anthony,

> First (of all), i thinks it's better to explain in the readme.md that copyCasConfiguration only copy /cas-overlay-template-version/etc/cas/config into /etc/cas/config to avoid bad interpretation.
Secondly why copyCasConfiguration doesn't copy entire folder /cas-overlay-template-version/etc/cas/ into /etc/cas including thekeystore with eventually backup five old configuration ?

I don't know either, I have no idea there was a function call copyCasConfiguration until you mentioned it, since I am just a user of CAS just like you :)

If you think that the CAS overlay project documentation / behavior is to be enhance, the best thing to do is go and submit a Pull Request to go and fix the problem:

Cheers!
- Andy

ratm

unread,
Nov 6, 2019, 4:59:30 AM11/6/19
to CAS Community
Thanks, i do that.

Cheers,
 Anthony

ratm

unread,
Nov 7, 2019, 4:40:10 AM11/7/19
to CAS Community
Hello,

The only log i have concerning services :

2019-11-07 10:25:29,447 INFO [org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration] - <


2019-11-07 10:25:30,792 WARN [org.apereo.cas.config.CasCoreServicesConfiguration] - <Runtime memory is used as the persistence storage for retrieving and persisting service definitions. Changes that are made to service definitions during runtime WILL be LOST when the CAS server is restarted. Ideally for production, you should choose a storage option (JSON, JDBC, MongoDb, etc) to track service definitions.>


2019-11-07 10:25:31,958 INFO [org.apereo.cas.services.AbstractServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>


Cheers,
 Anthony

ratm

unread,
Nov 7, 2019, 5:18:43 AM11/7/19
to CAS Community
Hello,

On your cas 5.3 example json file are under
cas-overlay-docker/etc/cas/config/services/Everything-1.json

But with cas-overlay-template-6.1 the structure is :
cas-overlay-template-6.1/etc/cas/services

with cas-overlay-template-6.1 where should we put the json files ? ......

ratm

unread,
Nov 7, 2019, 8:07:58 AM11/7/19
to CAS Community
I found !

in cas.properties
cas.service-registry.json.location=file:/etc/cas/services

is not good for cas 6.1 but doesn't produce an error ....

the good way :
cas.serviceRegistry.initFromJson=true
cas.serviceRegistry.json.location=file:/etc/cas/services

ratm

unread,
Nov 7, 2019, 8:45:01 AM11/7/19
to CAS Community
Thanks rbon, Andy Ng and Pol Dellaiera
Reply all
Reply to author
Forward
0 new messages