You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GlassFish Version (and build number): Eclipse GlassFish 7.0.19 and 7.0.15 platform (tested on both)
JDK version: 17
Jakarta EE version: Jakarta EE 10
OS: Ubuntu 22.04 and Ubuntu 24.04
Database: PostgreSQL
Problem Description
When reloading or navigating between pages in a Jakarta EE application running on GlassFish, SecurityContext roles unexpectedly disappear, resulting in inconsistent access control behavior and unexpected 403 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
Authenticate a user with specific roles.
Navigate between pages or refresh the page.
Observe that suddenly securityContext.getCallerPrincipal() remains non-null, but role-checking methods like securityContext.isCallerInRole("roleName") return false for roles that should be active. Similarly securityContext.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:
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.
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: