Repository navigation
JSPWIKI-94 Log in with OpenID Connect through Keycloak - #643
Open
arturobernalg wants to merge 3 commits into
Open
arturobernalg wants to merge 3 commits into
arturobernalg wants to merge 3 commits into
Conversation
A new jspwiki-oidc module uses the pac4j filters to send the user to the identity provider and a filter that presents the logged in user to the wiki as a container login. The wiki recognizes the user as authenticated without changes in its authentication code. Work in progress, not ready for review.
…d a test The filters of the proof of concept are commented out in web.xml, as the container managed authentication section is, and the war does not include the module. Adds the ChangeLog entry and a test of the request wrapper.
…onnect module OidcAuthorizer declares that the container handles the login and takes the roles from the property jspwiki.oidc.roles, so Login.jsp and the roles of the identity provider work as with a container login. The logout filter ends the session of the identity provider and returns to the wiki. The war includes the module with the profile oidc. Adds the tests of the authorizer and a description of how to enable it.
arturobernalg
marked this pull request as ready for review
November 18, 2026 06:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds optional OpenID Connect login to JSPWiki, as asked in JSPWIKI-94, following the guide Alex attached to the ticket. It has been tried with Keycloak.
cc @spyhunter99 @juanpablo-santos, could you review it?
How it works: the pac4j filters send the user to the identity provider and receive the answer. OidcIdentityFilter runs before the filters of the wiki and presents the logged in user as a user authenticated by the container, through getRemoteUser(), getUserPrincipal() and isUserInRole(). The web.xml already documents that a filter placed before WikiServletFilter that returns these values makes the wiki treat the user as authenticated. OidcAuthorizer, an authorizer for jspwiki.authorizer, declares that the container handles the login, so Login.jsp behaves as with a container login, and takes the role names from jspwiki.oidc.roles (Admin and Authenticated by default).
What the PR contains:
I checked it with a real Keycloak and the wiki with its pages in Tomcat:
It uses the Keycloak client of pac4j, as the attachment does. It adds pac4j (pac4j-oidc 6.5.5, jakartaee-pac4j 8.0.3) as dependencies of the new module, only included in the war with the profile.
I did not try other identity providers, nor the portable build.