Issue Details (XML | Word | Printable)

Key: OPENEJB-901
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dain Sundstrom
Reporter: Luis Fernando Planella Gonzalez
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenEJB

Fixed broken isCallerInRole when using Tomcat JAASRealm with the TomcatSecurityService

Created: 21/Aug/08 07:44 PM   Updated: 29/Oct/08 07:53 PM
Return to search
Component/s: tomcat
Affects Version/s: 3.0
Fix Version/s: 3.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works ejb-examples.war 2008-08-23 09:45 PM Dain Sundstrom 28 kB
File Licensed for inclusion in ASF works jaas.conf 2008-08-21 08:06 PM Luis Fernando Planella Gonzalez 0.1 kB
Java Archive File Licensed for inclusion in ASF works realm.jar 2008-08-23 09:45 PM Dain Sundstrom 1 kB
File Licensed for inclusion in ASF works test-updated.war 2008-09-03 01:35 PM Luis Fernando Planella Gonzalez 12 kB
File Licensed for inclusion in ASF works test.war 2008-08-25 12:44 PM Luis Fernando Planella Gonzalez 18 kB
File Licensed for inclusion in ASF works test.war 2008-08-21 08:06 PM Luis Fernando Planella Gonzalez 18 kB
Environment: Ubuntu Linux 8.04, i386

Resolution Date: 20/Oct/08 12:49 PM


 Description  « Hide
TomcatSecurityService currently uses only the default container Realm to authenticate users, ignoring a context-defined Realm.
So, an user is correctly authenticated on the web application (for example, through j_security_check), but is not correctly authenticated in EJBs.
Attached, is a war file and a jaas configuration file, which should have the system property java.security.auth.login.config set to it.
To test, first authenticate by visiting http://localhost:8080/test/protected.jsp. Any username / password is validated, and the "user" role is granted. Then browse to http://localhost:8080/test/test, and a permission denied exception is thrown, because the role "user" is not granted.
Another test is comment the @RolesAllowed("user") in TestServiceBean.sayHello() method. In this case, the isCallerInRole("user") is alwais false.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Luis Fernando Planella Gonzalez made changes - 21/Aug/08 08:06 PM
Field Original Value New Value
Attachment jaas.conf [ 12388691 ]
Attachment test.war [ 12388690 ]
Luis Fernando Planella Gonzalez made changes - 21/Aug/08 08:10 PM
Description TomcatSecurityService currently uses only the default container Realm to authenticate users, ignoring a context-defined Realm.
So, an user is correctly authenticated on the web application (for example, through j_security_check), but is not correctly authenticated in EJBs.
TomcatSecurityService currently uses only the default container Realm to authenticate users, ignoring a context-defined Realm.
So, an user is correctly authenticated on the web application (for example, through j_security_check), but is not correctly authenticated in EJBs.
Attached, is a war file and a jaas configuration file, which should have the system property java.security.auth.login.config set to it.
To test, first authenticate by visiting http://localhost:8080/test/protected.jsp. Any username / password is validated, and the "user" role is granted. Then browse to http://localhost:8080/test/test, and a permission denied exception is thrown, because the role "user" is not granted.
Another test is comment the @RolesAllowed("user") in TestServiceBean.sayHello() method. In this case, the isCallerInRole("user") is alwais false.
Dain Sundstrom made changes - 23/Aug/08 09:45 PM
Attachment realm.jar [ 12388804 ]
Dain Sundstrom made changes - 23/Aug/08 09:45 PM
Attachment ejb-examples.war [ 12388805 ]
Luis Fernando Planella Gonzalez made changes - 25/Aug/08 12:44 PM
Attachment test.war [ 12388841 ]
Luis Fernando Planella Gonzalez made changes - 03/Sep/08 01:35 PM
Attachment test-updated.war [ 12389424 ]
Luis Fernando Planella Gonzalez made changes - 20/Oct/08 12:49 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Blevins made changes - 29/Oct/08 07:34 PM
Fix Version/s 3.1 [ 12312761 ]
Assignee Dain Sundstrom [ dain ]
Summary TomcatSecurityService should use the context-specific Realm Fixed broken isCallerInRole when using Tomcat JAASRealm with the TomcatSecurityService