RunAs identity is not being propagated when first bean in unsecured.

Solution Verified - Updated -

Issue

I have a unsecure EJB_1 which calls another unsecure EJB_2 which in turn calls a secured EJB_3. All of the EJBs are EJB3 and located in the same application. All calls are executed through local interfaces.
ie.

client ---> EJB_1 --> EJB_2 --> EJB_3

I annotated EJB_1 with RunAs("EJB3Role") but the call on the EJB_3 fails with security exception. I had to put this annotation on EJB_2 in order for my call to EJB_1 get executed without a security exception.

I don't want to put the RunAs on EJB_2, I need it to be applied only for one method of EJB_1.

How can this be acheived?

Environment

JBoss Enterprise Application Platform 5.1.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content