[
https://issues.apache.org/jira/browse/KNOX-3217?focusedWorklogId=994732&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-994732
]
ASF GitHub Bot logged work on KNOX-3217:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Dec/25 11:36
Start Date: 04/Dec/25 11:36
Worklog Time Spent: 10m
Work Description: moresandeep commented on code in PR #1110:
URL: https://github.com/apache/knox/pull/1110#discussion_r2588658924
##########
gateway-provider-security-pac4j/pom.xml:
##########
@@ -28,6 +28,19 @@
<name>gateway-provider-security-pac4j</name>
<description>An extension of the gateway integrating pac4j as an
authentication provider.</description>
+ <repositories>
+ <repository>
Review Comment:
Why do we need to add shibboleth repo?
##########
gateway-provider-security-pac4j/src/main/java/org/apache/knox/gateway/pac4j/filter/Pac4jIdentityAdapter.java:
##########
@@ -84,13 +89,18 @@ public void doFilter(ServletRequest servletRequest,
ServletResponse servletRespo
final HttpServletRequest request = (HttpServletRequest) servletRequest;
final HttpServletResponse response = (HttpServletResponse) servletResponse;
- final JEEContext context = new JEEContext(request, response,
((Config)request.getAttribute(PAC4J_CONFIG)).getSessionStore());
- final ProfileManager<CommonProfile> manager = new
ProfileManager<>(context);
- final Optional<CommonProfile> optional = manager.get(true);
+ final JEEContext context = new JEEContext(request, response);
+ Config pac4jConfig = ((Config)request.getAttribute(PAC4J_CONFIG));
+ FrameworkParameters frameworkParameters = new
JEEFrameworkParameters(request, response);
+ SessionStore sessionStore =
pac4jConfig.getSessionStoreFactory().newSessionStore(frameworkParameters);
+ final ProfileManager manager = new ProfileManager(context, sessionStore);
+ final Optional<UserProfile> optional = manager.getProfile();
if (optional.isPresent()) {
- CommonProfile profile = optional.get();
+ UserProfile profile = optional.get();
logger.debug("User authenticated as: {}", profile);
- manager.remove(true);
+ //manager.removeProfiles(); would only work if session existed, but our
session store does not support sessions
Review Comment:
Let's remove the commented out line.
##########
gateway-provider-security-pac4j/pom.xml:
##########
@@ -28,6 +28,19 @@
<name>gateway-provider-security-pac4j</name>
<description>An extension of the gateway integrating pac4j as an
authentication provider.</description>
+ <repositories>
+ <repository>
Review Comment:
I found my answer at the bottom :)
Issue Time Tracking
-------------------
Worklog Id: (was: 994732)
Time Spent: 20m (was: 10m)
> Upgrade pac4j for JDK17
> -----------------------
>
> Key: KNOX-3217
> URL: https://issues.apache.org/jira/browse/KNOX-3217
> Project: Apache Knox
> Issue Type: Task
> Components: Build
> Affects Versions: 3.0.0
> Reporter: Tamás Marcinkovics
> Assignee: Tamás Marcinkovics
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> For JDK 17, we can upgrade pac4j to 6.3 and jee-pac4j to
> javaee-pac4j:8.0.1.
> https://www.pac4j.org/blog/jee_pac4j_vs_pac4j_jee.html
> https://github.com/pac4j/jee-pac4j
> https://github.com/pac4j/jee-pac4j/wiki/Migration-guide#--8x
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)