This demo secures a Jooby application with jooby-pac4j, the Jooby implementation of pac4j, the security engine for Java. If it is useful to you, please ⭐ star pac4j on GitHub: it helps other developers discover it!
A minimal Jooby (Netty) demo showcasing authentication with jooby-pac4j and pac4j:
- Form login (FormClient)
- Indirect Basic Auth (IndirectBasicAuthClient)
- CAS (CasClient)
It uses Jooby v4.x (jooby-pac4j) and pac4j v6.x.
- JDK 21+
- Maven 3.8+
- curl (for the CAS test script)
mvn -q clean package- Quick launcher (builds and starts the demo):
./run.sh- Or run the fat JAR directly:
java -jar target/jooby-pac4j-demo-*.jarThe server starts on http://localhost:8080
- / — Home page with links
- /form/index — Protected by FormClient (use username = password)
- /basicauth/index — Protected by Indirect Basic Auth (use username = password)
- /cas/index — Protected by CAS (redirects to the demo CAS server)
- /logout — Local logout via pac4j
