-
1. Re: @RunAsPrincipal not working ?
jw Mar 5, 2012 3:39 AM (in response to jw)Doing it in jboss-ejb3.xml works:
{code:xml}
<?xml version="1.0"?>
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:s="urn:security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
version="3.1"
impl-version="2.0">
<jboss:enterprise-beans>
<session>
<ejb-name>MyBeanWrapper</ejb-name>
<ejb-class>test.MyBeanWrapper</ejb-class>
<session-type>Stateless</session-type>
<local-bean />
<security-identity>
<run-as>
<role-name>TEST</role-name>
</run-as>
<use-caller-identity />
</security-identity>
</session>
</jboss:enterprise-beans>
<assembly-descriptor>
<s:security>
<ejb-name>MyBeanWrapper</ejb-name>
<s:run-as-principal>test</s:run-as-principal>
<s:security-domain>other</s:security-domain>
</s:security>
</assembly-descriptor>
</jboss:ejb-jar>
{code}
Same thing with annotations does not work (bug?):
{code:java}
@RunAs("TEST")
@RunAsPrincipal("test")
@SecurityDomain("other")
public class MyBeanWrapper {
...
}
{code}
-
2. Re: @RunAsPrincipal not working ?
anzorishe Oct 29, 2013 8:39 AM (in response to jw)Probably this is related to the following Issue [JBPAPP-7685] RunAs does not work on EJB timer bean timeout methods - JBoss Issue Tracker
There is no interceptor for RunAs in some version of Jboss. What version of Jboss did you use?