Hi Bob,
I had a similar regression from 6.0 to 6.1. The problem is that
EmbeddedResourceBasedServiceRegistry is registered in the registries chain.
So, when the ServiceRegistryInitializer.java checks at row 66 if the json
service exists already, it is found from
EmbeddedResourceBasedServiceRegistry and then it is not added to
JpaTicketRegistry.
I solved somehow by avoiding the
"embeddedJsonServiceRegistryExecutionPlanConfigurer" bean, just commenting
it away in CasServiceRegistryInitializationConfiguration.java
// @Bean
// @ConditionalOnMissingBean(name =
"embeddedJsonServiceRegistryExecutionPlanConfigurer")
// public ServiceRegistryExecutionPlanConfigurer
embeddedJsonServiceRegistryExecutionPlanConfigurer() {
// return plan ->
plan.registerServiceRegistry(embeddedJsonServiceRegistry());
// }
I don't know if there will be any collateral problems, by the way now json
services are correctly copied on JpaTicketRegistry.
Wouldn't know how to fix it in a clean way as to make a pr.
Hope it helps
Regards
Michele
On Thursday, January 30, 2020 at 1:00:47 PM UTC+1, Bob wrote:
>
> Thanks Misagh and Ray,
>
> I cloned the cas-overlay-template in a new location and used the settings
> Misagh suggested but I still have the same problem that my casdb still has
> an empty regex_registered_service table.
> Here's what I'm using:
>
> Here's what I'm using:
>
> CAS Version: 6.1.0
> CAS Branch: 6.1.x
> CAS Commit Id: c92590730249df0cf26fd1b4bebd8aea8447b256
> CAS Build Date/Time: 2019-10-28T02:43:18Z
> Spring Boot Version: 2.2.0.RELEASE
> Spring Version: 5.2.0.RELEASE
> Java Home: C:\Programs\Java\amazon-corretto\jdk11.0.3_7
> Java Vendor: Amazon.com Inc.
> Java Version: 11.0.3
>
>
> My dependencies in build.gradle:
>
> dependencies {
> // Other CAS dependencies/modules may be listed here...
> compile
> "org.apereo.cas:cas-server-support-ldap:${project.'cas.version'}"
> compile
> "org.apereo.cas:cas-server-support-jdbc-drivers:${project.'cas.version'}"
> compile
> "org.apereo.cas:cas-server-support-jpa-service-registry:${project.'cas.version'}"
> }
>
>
> My minimum cas.propertie (I omitted the LDAP part since that's working
> fine):
>
> cas.server.name: https://localhost:8443
> cas.server.prefix: ${cas.server.name}/cas
>
> logging.config: file:/etc/cas/config/log4j2.xml
>
> server.ssl.key-store=file:/etc/cas/keystore.jks
> server.ssl.key-store-password=
> server.ssl.key-password=xxx
>
> cas.serviceRegistry.initFromJson=true
> cas.serviceRegistry.json.location=file:/etc/cas/config/services
>
> cas.serviceRegistry.jpa.user=xx
> cas.serviceRegistry.jpa.password=xxx
> cas.serviceRegistry.jpa.driverClass=com.mysql.cj.jdbc.Driver
>
> cas.serviceRegistry.jpa.url=jdbc:mysql://localhost:3306/casdb?allowPublicKeyRetrieval=true=UTF-8=FALSE
> cas.serviceRegistry.jpa.dialect=org.hibernate.dialect.MySQL57InnoDBDialect
> cas.serviceRegistry.jpa.ddlAuto=update
>
>
> When I run CAS 6.1.0 I see:
>
> [org.apereo.cas.services.AbstractServicesManager] - from [EmbeddedResourceBasedServiceRegistry,JpaServiceRegistry].>
>
>
> I can then use CAS to login to my application, but it does not insert any
> Service Registry into the MySQL casdb.
> Do you see anything wrong in my setup?
> Thanks,
>
> Bob
>
> On Wednesday, January 29, 2020 at 11:21:24 AM UTC+1, Misagh Moayyed wrote:
>>
>>
>> Something along the following lines should work:
>>
>> cas.serviceRegistry.initFromJson=true
>> cas.serviceRegistry.json.location=file:/etc/cas/config/services
>>
>> - Then, make sure your JSON files are in the above noted directory.
>> - Then, make sure your overlay contains a reference to the JPA service
>> registry
>>
>> (You do not need to include the JSON service registry, IIRC, in the
>> overlay)
>>
>> Then, on startup, CAS will import your JSON files from that directory
>> over to the real (JPA) service registry.
>>
>> YMMV.
>>
>>
>> On Wednesday, January 29, 2020 at 12:56:11 AM UTC+4, rbon wrote:
>>>
>>> Bob,
>>>
>>> We are using the 5.1.5 version of cas management. You only need to
>>> upgrade it if you want newer features, etc.
>>> I also have grumblings about the 6.x version. I put off upgrading cas
>>> management until it settles.
>>>
>>> Ray
>>>
>>> On Tue, 2020-01-28 at 12:34 -0800, Bob wrote:
>>>
>>> Hi Ray,
>>>
>>> No, I'm currently just using the cas overlay (6.1.x).
>>> I did try to get cas management working but had some issue with a
>>> pre-defined service registry in some kind of git repo.
>>> Whenever I tried to enter a service via cas management, there was no
>>> option to save it to my database. All it ever did was show this 1 entry
>>> from a git repo.
>>> SInce I did get it working (reading my json file and store it in MySQL
>>> database) without cas management for version 5.3.9, I assumed it would work
>>> for version 6 as well.
>>> Do you think cas management is the only way to get it stored in the
>>> database? I might have another look at it then.
>>> Thanks,