here my security settings from the ejb :

user.properties
username=password
roles.properties
username=userrole
###################################
ejb-jar.xml
<?xml version="1.0"?>

<!DOCTYPE ejb-jar PUBLIC 
"-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" 
"http://java.sun.com/dtd/ejb-jar_2_0.dtd";>

<ejb-jar>

 <enterprise-beans>

   
     <ejb-name>EchoBean</ejb-name>
     MBeanServiceAndJaas.EchoHome
     MBeanServiceAndJaas.Echo
     <ejb-class> MBeanServiceAndJaas.EchoBean</ejb-class>
     <session-type>Stateless</session-type>
     <transaction-type>Container</transaction-type>     

  
 </enterprise-beans>
  
  <!-- Jaas = On -->
  
  <assembly-descriptor>
  
  <security-role>
     <role-name>userrole</role-name>
  </security-role>
  
   <method-permission>
     <role-name>userrole</role-name>
     
       <ejb-name>EchoBean</ejb-name>
       <method-name>*</method-name>
     
   </method-permission>  
  </assembly-descriptor>

 <!-- Jaas = Off -->

 <!--assembly-descriptor>

   <security-role>
      
         everyone
      
     <role-name>everyone</role-name>
   </security-role>

   <method-permission>
     <role-name>everyone</role-name>
     
       <ejb-name>EchoBean</ejb-name>
       <method-name>*</method-name>
     
   </method-permission>

   <container-transaction>
     
        <ejb-name>EchoBean</ejb-name>
        <method-name>*</method-name>
     
     <trans-attribute>Required</trans-attribute>
   </container-transaction>

 </assembly-descriptor-->

</ejb-jar>
############################################
jboss.xml

<?xml version="1.0"?>



     <!-- Jaas = On -->
     <security-domain>java:/jaas/ServiceSecurity</security-domain>

     <enterprise-beans>

       
         <ejb-name>EchoBean</ejb-name>
         <jndi-name>Echo</jndi-name>

       
     </enterprise-beans>


##############################################
login-config.xml
    <application-policy name = "ServiceSecurity">
       
          <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
             flag = "required" />
          <!--module-option name = "principal">username</module-option-->
       
    </application-policy>
###############################################
auth.conf

ServiceSecurity {
   // jBoss LoginModule
   org.jboss.security.ClientLoginModule  required
   
   ;
   //principal="username"
   // Put your login modules that need jBoss here
};

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3849713#3849713

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3849713


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to