[
https://issues.apache.org/jira/browse/KNOX-3217?focusedWorklogId=994756&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-994756
]
ASF GitHub Bot logged work on KNOX-3217:
----------------------------------------
Author: ASF GitHub Bot
Created on: 04/Dec/25 13:27
Start Date: 04/Dec/25 13:27
Worklog Time Spent: 10m
Work Description: bonampak commented on code in PR #1110:
URL: https://github.com/apache/knox/pull/1110#discussion_r2589082611
##########
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:
done
Issue Time Tracking
-------------------
Worklog Id: (was: 994756)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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)