Thanks Romain I tried to get realmName from StandardContext and got the realm name as /tomee which is not my project name . I am in an assumption that Tomee will create application's web context as its realm name . Correct me If I am wrong . If it is correct . I has to get realm name as /<my-project> not /tomee which is tomee manager app.
Mean while I found a way to login to tomeewebapp so that ejb context will bind username at their context. For that I need to send Principal and Realm as null only runAs argument is passed to Even though we pass realm and principal as null security service will create subject and adds the login user in to stack. TomcatSecurityService ss = (TomcatSecurityService) SystemInstance.get().getComponent(SecurityService.class); //ss.enterWebApp(null, null, login); // realm and principal are sending as null as Realm is hard coded ss.enterWebApp(realm, principal, login); My question is why I am getting realmName as /tomee instead of /<my-project> . Please reply to me . For your reference I had created a sample maven project which I will be using to implement security . If you have Time please go through . sample project code : security.zip <http://tomee-openejb.979440.n4.nabble.com/file/n4676835/security.zip> Thanks -- View this message in context: http://tomee-openejb.979440.n4.nabble.com/Setting-Realm-name-for-Tomee-application-tp4676811p4676835.html Sent from the TomEE Dev mailing list archive at Nabble.com.
