-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jakarta Security: SecurityContext roles intermittently lost on page reload or navigation #25206
Comments
Hi @riyadomf, do you have a reproducer application for this? Can you, please, share it with us or prepare a simple application on which you can reproduce the issue? It would greatly help us investigate the issue and if it's caused by a bug, fix it. |
Hi @riyadomf, would you be able to create a simple reproducer that can be easily used to reproduce the issue? |
+1 |
I did not encounter this issue in GlassFish 7.0.8. However, I experienced it in versions 7.0.14, 7.0.15, and 7.0.19. |
Environment Details
Problem Description
When reloading or navigating between pages in a
Jakarta EE
application running onGlassFish
,SecurityContext
roles unexpectedly disappear, resulting in inconsistent access control behavior and unexpected403
Forbidden errors. The user principal (securityContext.getCallerPrincipal()
) is still present, but roles are sometimes unavailable, causing access restrictions even for authenticated users with valid roles.Steps to reproduce
securityContext.getCallerPrincipal()
remains non-null, but role-checking methods likesecurityContext.isCallerInRole("roleName")
return false for roles that should be active. SimilarlysecurityContext.getAllDeclaredRoles()
returns only**
role, while all other roles temporarily disappear. However, The roles reappear and function correctly upon the next reload.Impact of Issue
This issue disrupts role-based access control in applications, causing intermittent authorization failures during navigation or page refreshes. As a result, users may lose access to certain features or pages even though they are authenticated, leading to inconsistent user experiences and potential security concerns. This behavior is particularly problematic for applications relying on stable, role-based permissions across sessions.
Type: Bug
Component: Security / Authentication
Priority: High
The text was updated successfully, but these errors were encountered: