Information
Access to the EJB methods should be protected appropriately using roles in deployment descriptor or annotations.
Protecting the appropriate EJB methods will ensure that users have to provide the correct credentials to access them.
Solution
Set <method-permission> elements in the ejb-jar.xml deployment descriptor file of each application or use annotations.Example using method-permission:
<method-permission>
<role-name>teller</role-name>
<method>
<ejb-name>myEJB1</ejb-name>
<method-name>getBalance</method-name>
</method>
</method-permission>
Example using annotations:
@RolesAllowed("teller")
public class myEJB1 {
public void getBalance () {...}
...
}