2 Replies Latest reply on Jan 14, 2015 7:10 AM by valsaraj viswanathan

    Securing EJBs in WildFly

    valsaraj viswanathan Master

      Hi,

       

      I am migrating from an old version to WildFly. In my old version EJBs are secured as follows:

       

      jboss.xml:

      <jboss>

        <security-domain>java:/jaas/ldap</security-domain>

       

      Some EJBs won't have any annotations.

      Some of them are annotted like @RolesAllowed, @PermitAll, @DenyAll, @RunAs.

       

      When I migarted to WildFly:

       

      jboss-ejb3.xml:

      <s:security>

        <ejb-name>*</ejb-name>

        <s:security-domain>ldap</s:security-domain>

      </s:security>

      Some EJBs won't have any annotations.

      Some of them are annotted like @RolesAllowed, @PermitAll, @DenyAll, @RunAs.


      But the problem is that even if the EJBs won't have anything like @RolesAllowed, @PermitAll, @DenyAll, @RunAs, they are secured and getting EJBAccessException.


      Should I remove <security-domain> from jboss-ejb3.xml deployment descriptor and set it using @SecurityDomain annotation on the EJBs that are annotted like @RolesAllowed, @PermitAll, @DenyAll, @RunAs?

      Please suggest best method to apply this in WildFly.


      Thanks in advance!