tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hanfland <MHanfl...@vitalchek.com>
Subject OpenEJB / TomEE Security Realm
Date Wed, 02 Oct 2013 19:04:32 GMT
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.

Mime
View raw message