[ 
https://issues.apache.org/jira/browse/TOMEE-2763?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Yakushev Mikhail updated TOMEE-2763:
------------------------------------
    Description: 
Sample application: [^tomee-runas.zip]

 

EJB 1
{code:java}
@LocalBean
@Stateless(name = "MyStateless")
public class MyStatelessBean {
    @Resource
    private SessionContext sessionContext;
    @EJB
    private UserBean userBean;    public MyStatelessBean() {
    }    public void test() {
        System.out.println("ejb WITHOUT @RunAs, username from sessionContext 1: 
" + sessionContext.getCallerPrincipal().getName());
        System.out.println("ejb WITHOUT @RunAs, username from another ejb: " + 
userBean.currentUserName());
        System.out.println("ejb WITHOUT @RunAs, username from sessionContext 2: 
" + sessionContext.getCallerPrincipal().getName());
    }
}{code}

  was:
Sample application: [^tomee-runas.zip]

 

 


> Security Principal is lost after calling a method from ejb with @RunAs 
> annotation
> ---------------------------------------------------------------------------------
>
>                 Key: TOMEE-2763
>                 URL: https://issues.apache.org/jira/browse/TOMEE-2763
>             Project: TomEE
>          Issue Type: Bug
>            Reporter: Yakushev Mikhail
>            Priority: Major
>         Attachments: tomee-runas.zip
>
>
> Sample application: [^tomee-runas.zip]
>  
> EJB 1
> {code:java}
> @LocalBean
> @Stateless(name = "MyStateless")
> public class MyStatelessBean {
>     @Resource
>     private SessionContext sessionContext;
>     @EJB
>     private UserBean userBean;    public MyStatelessBean() {
>     }    public void test() {
>         System.out.println("ejb WITHOUT @RunAs, username from sessionContext 
> 1: " + sessionContext.getCallerPrincipal().getName());
>         System.out.println("ejb WITHOUT @RunAs, username from another ejb: " 
> + userBean.currentUserName());
>         System.out.println("ejb WITHOUT @RunAs, username from sessionContext 
> 2: " + sessionContext.getCallerPrincipal().getName());
>     }
> }{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to