CAS 5.0.x Integration w/ Apache ZooKeeper


Contributed Content
Giovanni Morelli (Email: giannimorell at gmail.com, Github: @GiovanniMorelli) was kind enough to share this guide.

I have created a cas-server-core-configuration-cloud-zookeeper module for CAS 5.0.4 based on cas-server-core-configuration-cloud-mongo When CAS is started, it reads all properties under zookeeper’s path: /cas/config/cas without the need to configure cas.properties.

The project source code is available here.

Configuration

  • Add parameter cas.spring.cloud.zookeeper.uri=localhost:2181 in bootstrap.properties
  • Add configurations on Zookeeper. Example: cas.server.name: https://localhost:9327
  • Start CAS.

Build

Download the codebase for CAS 5.0.4 first and add the project source code into the core directory.

Make the following changes:

  • settings.gradle (Root project)
    • Add include "core:cas-server-core-configuration-cloud-zookeeper"
  • gradle.properties (Root project)
    • Update version zookeeper : zookeeperVersion=3.4.10
    • Add springCloudZookeeperVersion=1.0.4.RELEASE
  • build.gradle (into project cas-server-core-configuration-cloud-zookeeper)
description = "Apereo CAS Core Configuration - Zookeeper"

dependencies {
  compile libraries.springboot
  compile libraries.spring
  compile libraries.springcloud
  compile libraries.zookeeper
}

Classes used in the ZooKeeper project:

/cas-server-core-configuration-cloud-zookeeper/src/main/java/org/apereo/cas/ZookeeperPropertySource.java
/cas-server-core-configuration-cloud-zookeeper/src/main/java/org/apereo/cas/ZookeeperPropertySourceLocator.java
/cas-server-core-configuration-cloud-zookeeper/src/main/java/org/apereo/cas/config/ZookeeperCloudConfigBootstrapConfiguration.java

Build the codebase with gradlew clean build --parallel -x test -x javadoc -x check.

Overlay

Add this configuration in pom.xml:

<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-core-configuration-cloud-zookeeper</artifactId>
    <version>${cas.version}</version>
</dependency>

TODO

  • When you add a new configuration to Zookeeper, reload the configuration property automatically in CAS.

Related Posts

CAS 6.0.0 RC3 Feature Release

...in which I present an overview of CAS 6.0.0 RC3 release.

CAS 6.0.0 RC2 Feature Release

...in which I present an overview of CAS 6.0.0 RC2 release.

Apereo CAS - dotCMS SAML2 Integration

Learn how to integrate dotCMS, a Content Management System and Headless CMS, with Apereo CAS running as a SAML2 identity provider.

Effective Software Troubleshooting Tactics

A collection of what hopefully are obvious troubleshooting tactics when it comes to diagnosing software deployment issues and configuration problems.

Apereo CAS - MaxMind Geo2IP ISP Integration

Learn how you may determine the Internet Service Provider, organization name, and autonomous system organization and number associated with the user's IP address in CAS using MaxMind services and present warnings in the authentication flow for the end-user if an IP address is matched.

Notes from Better by Design 2018

Be interested in humans and human success.

Apereo CAS - Authentication Lifecycle Phases

Tap into the Apereo CAS authentication engine from outside, and design extensions that prevent an unsuccessful authentication attempt or warn the user after-the-fact based on specific policies of your choosing.

CAS 6.0.0 RC1 Feature Release

...in which I present an overview of CAS 6.0.0 RC1 release.

Apereo CAS Delegated Authentication with ADFS

Learn how your Apereo CAS deployment may be configured to delegate authentication to Microsoft ADFS.

Apereo CAS Swag with Swagger

Enable Swagger integration with your Apereo CAS APIs.