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

JWT Of All Things With CAS

A short tutorial on how to let Apereo CAS handle authentication events accompanied by JWTs.

CAS 5.2.0 RC4 Feature Release

...in which I present an overview of CAS 5.2.0 RC4 release.

August 2017 uPortal Slack summary

Summarizing Slack traffic about uPortal in August 2017.

CAS 5.1.x Load Tests by Lafayette College

Lafayette College shares the results of stress tests executed against a recent CAS 5.1.x deployment.

CAS 5.2.0 RC3 Feature Release

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

Do State The Obvious

A short and sweet reminder and explanation of how marketing in tech works.

Stop Writing Code

A legitimate, comprehensive and inescapably detailed account of the spiderweb of deceit in today’s technology scene; The open-source software ecosystem where victims fall prey to the Goldilocks Syndrome of software customizations and home-grown functionality. This guide aims to uncover the deepest darkest secrets of this treacherous path and yet intentionally offers no hopes or viable solutions at all…except one.

CAS 5.1.x User Swap - Cause and Analysis

Travis Schmidt shares an analysis of chasing down a bug in CAS 5.1.x where user identities were swapped.

Summer 2017 uPortal Roadmap Update

Primarily summarizing the Open Apereo 2017 uPortal Roadmap BOF.

Interrupt CAS With Class

An overview of a recent CAS 5.2.x feature that allows one to interrupt the authentication flow with notifications and advertisements, dictating CAS should treat the authenticated session with configuration and compassion.