How to secure a Spring Security client application with OIDC (using pac4j)
java
dev.to
If you already have Spring Security in your application, with hasRole rules, @PreAuthorize on services and code reading SecurityContextHolder and you want to add an OpenID Connect login, while keeping that authorization code, you can use pac4j for that. Whatever the provider (Keycloak, Microsoft Entra ID, Okta, a CAS server, etc.), once pac4j has authenticated the user, it can make that user available to Spring Security. The spring-security-pac4j bridge does this. It transfers the pac4j profil