You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Mark Hanfland <MH...@vitalchek.com> on 2013/10/02 21:04:32 UTC

OpenEJB / TomEE Security Realm

I am converting from JBoss and unsure how to set the security realm for my
EJBs in TomEE Plus /OpenEJB

In JBoss there is an annotation
(org.jboss.annotation.security.SecurityDomain) you place on the EJB bean
@SecurityDomain(value = "MySecurityRealm")

For TomEE/OpenEJB what is the equivalent??

I am not sure, but I think I have the realm created correctly.

Added in server.xml
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="MySecurityRealm"
           
userClassNames="org.apache.openejb.core.security.AbstractSecurityService$User"
           
roleClassNames="org.apache.openejb.core.security.AbstractSecurityService$Group">
</Realm>

Created login.conf with the following 

MySecurityRealm {
    org.apache.openejb.core.security.jaas.SQLLoginModule required
    dataSourceName="MyDataSource"
	digest MD5
	encoding base64
    userSelect="SELECT USER_NAME,PASSWORD FROM ADMIN_USER WHERE USER_NAME=?"
    groupSelect="SELECT USER_NAME, ROLE_CODE FROM ADMIN_ROLE,
ADMIN_USER_ROLE, ADMIN_USER WHERE ADMIN_USER.ADMIN_USER_ID =
ADMIN_USER_ROLE.ADMIN_USER_ID AND ADMIN_ROLE.ADMIN_ROLE_ID =
ADMIN_USER_ROLE.ADMIN_ROLE_ID AND ADMIN_USER.USER_NAME=?"
}; 

pointed Tomcat to it using  
SET
"CATALINA_OPTS=-Djava.security.auth.login.config=%CATALINA_HOME%/conf/login.conf"




--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-TomEE-Security-Realm-tp4665393.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEJB / TomEE Security Realm

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Ok but does it prevent your app to work?

Basically the ejb will inherit from the conf you did.

If it doesnt work please work to a sample we could test against
Le 3 oct. 2013 01:06, "Mark Hanfland" <MH...@vitalchek.com> a écrit :

> I have defined a JAAS realm using SQLLoginModule in Tomcat/Tomee.
>  How/Where
> do I point my EJBs to utilize that realm.
>
> In JBoss there is an annotation on the ejb bean to tell it which realm to
> associate to the ejb, I can't find an equivalent in OpenEJB.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEJB-TomEE-Security-Realm-tp4665393p4665395.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: OpenEJB / TomEE Security Realm

Posted by Mark Hanfland <MH...@vitalchek.com>.
I have defined a JAAS realm using SQLLoginModule in Tomcat/Tomee.  How/Where
do I point my EJBs to utilize that realm.  

In JBoss there is an annotation on the ejb bean to tell it which realm to
associate to the ejb, I can't find an equivalent in OpenEJB.



--
View this message in context: http://openejb.979440.n4.nabble.com/OpenEJB-TomEE-Security-Realm-tp4665393p4665395.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: OpenEJB / TomEE Security Realm

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

What's the issue?
Le 2 oct. 2013 21:50, "Mark Hanfland" <MH...@vitalchek.com> a écrit :

> I am converting from JBoss and unsure how to set the security realm for my
> EJBs in TomEE Plus /OpenEJB
>
> In JBoss there is an annotation
> (org.jboss.annotation.security.SecurityDomain) you place on the EJB bean
> @SecurityDomain(value = "MySecurityRealm")
>
> For TomEE/OpenEJB what is the equivalent??
>
> I am not sure, but I think I have the realm created correctly.
>
> Added in server.xml
> <Realm className="org.apache.catalina.realm.JAASRealm"
> appName="MySecurityRealm"
>
>
> userClassNames="org.apache.openejb.core.security.AbstractSecurityService$User"
>
>
> roleClassNames="org.apache.openejb.core.security.AbstractSecurityService$Group">
> </Realm>
>
> Created login.conf with the following
>
> MySecurityRealm {
>     org.apache.openejb.core.security.jaas.SQLLoginModule required
>     dataSourceName="MyDataSource"
>         digest MD5
>         encoding base64
>     userSelect="SELECT USER_NAME,PASSWORD FROM ADMIN_USER WHERE
> USER_NAME=?"
>     groupSelect="SELECT USER_NAME, ROLE_CODE FROM ADMIN_ROLE,
> ADMIN_USER_ROLE, ADMIN_USER WHERE ADMIN_USER.ADMIN_USER_ID =
> ADMIN_USER_ROLE.ADMIN_USER_ID AND ADMIN_ROLE.ADMIN_ROLE_ID =
> ADMIN_USER_ROLE.ADMIN_ROLE_ID AND ADMIN_USER.USER_NAME=?"
> };
>
> pointed Tomcat to it using
> SET
>
> "CATALINA_OPTS=-Djava.security.auth.login.config=%CATALINA_HOME%/conf/login.conf"
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/OpenEJB-TomEE-Security-Realm-tp4665393.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>