How can I integrate Seam security and the web container security in JBoss?
Environment
- JBoss Enterprise Application Platform (EAP)
- 4.x
- 5.x
- Seam 2
Issue
- How can I integrate Seam security and the web container security in JBoss?
- We need the security context to get propagated to the EJB layer so that secured EJBs can be invoked.
Resolution
- Add $JBOSS_HOME/server/$PROFILE/deploy/jbossweb.sar/jboss-web-service.jar to the seam application
- Add the following code snippet to the authenticate method of the Authentication class:
WebAuthentication webAuthentication = new WebAuthentication(); webAuthentication.login(credentials.getUsername(), credentials.getPassword());The Authentication class cannot be an EJB. It must be a web component.
- Add a WEB-INF/jboss-web.xml that defines a security domain
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
