Skip to content

Commit

Permalink
Fix for eclipse-ee4j#25141 - random 403 responses
Browse files Browse the repository at this point in the history
The securityContext is stateful, cannot be shared among requests. 
RealmAdapter stores the principal from request to it. We need to create 
a copy of the default context for each request instead of 
using the shared default context.
  • Loading branch information
OndroMih committed Dec 17, 2024
1 parent 0693864 commit 6df6809
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ public static void reset(SecurityContext securityContext) {
public static SecurityContext getCurrent() {
SecurityContext securityContext = currentSecurityContext.get();
if (securityContext == null) {
securityContext = defaultSecurityContext;
securityContext = generateDefaultSecurityContext();
currentSecurityContext.set(securityContext);
}

return securityContext;
Expand Down

0 comments on commit 6df6809

Please sign in to comment.