How bujiio/buji-pac4j works
Project type and purpose
• This is a Java-based security bridge library (buji-pac4j) that integrates the pac4j security engine into Apache Shiro.
• Its sole purpose is to adapt pac4j’s authentication/profile mechanism into Shiro’s subject/realm model, allowing legacy Shiro applications to leverage pac4j clients without full migration.
File structure
• Top‐level artifacts:
• pom.xml – Maven build, dependencies on pac4j & Shiro.
• src/main/java/io/buji/pac4j – core adapter code.
• src/main/resources/buji-pac4j-default.ini – default Shiro INI config for automatic installation.
• META-INF/services/org.apache.shiro.web.env.WebEnvironment – service loader entry to hook into Shiro.
• Key packages:
• context – ShiroSessionStore, Pac4jIniEnvironment
• realm – Pac4jRealm (Shiro Realm implementation)
• subject – Pac4jPrincipal, Pac4jSubjectFactory
• token – Pac4jToken
• util – ShiroHelper
• You also have adapter code under org.pac4j.framework/adapter (FrameworkAdapterImpl).
README for additional insights
• Confirms: “bridge only” for Shiro v2.x + pac4j v6.
• Usage is plug-and-play: drop the JAR, add to classpath, configure via INI, then configure your pac4j clients/filters in Shiro.
Details
• Package names (e.g., io.buji.pac4j.realm.Pac4jRealm) next to each bridge component.
• Default INI file loading (buji-pac4j-default.ini) feeding into WebEnvironment.
• SessionStore delegation: Pac4jSessionStore → ShiroSession.