2 Replies Latest reply on Dec 18, 2002 7:41 AM by blowagie

    XDoclet and Security

    blowagie

      Hello,
      I am trying to add security using XDoclet.
      I read the instructions, but I didn't succeed in doing this.
      I don't understand the cryptic descriptions concerning
      mergefiles.

      I have changed the build.xml like this:


      In the xdoclet-directory, I have the same directory-tree
      as my Bean myBean. I have a file jboss-myBean.xml and a
      file jboss-security.xml

      I haven't got any idea about what to put in this files
      (the examples seem to be very well hidden on the net),
      but since it are supposed to be 'mergefiles', I made them
      like this:

      jboss-myBean.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">

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


      and jboss-security.xml:






      /var/security/.keystore
      myPass



      I was kind of hoping that the jboss-security.xml would
      be copied to a jboss-service.xml and that the tag
      <security-domain> would have been inserted in the jboss.xml
      but I guess I am approaching this problem in a very
      simplistic way. As I said: I read the XDoclet docs, but
      they seem very cryptic to me.

        • 1. Re: XDoclet and Security
          pareis

          Although I didn't succeed with my entiry security setup, here's what I've found and put into my jboss-security.xml:

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

          That's it! Substitute 'testUsersAndRoles' with your preferred security domain name. Leave 'java:/jaas/' as is.

          andre

          • 2. Re: XDoclet and Security
            blowagie

            Yes! That worked! Thanks!!!
            I had tried it before, but I realize now that I had the file in the wrong directory. It has to be put in the xdoclet-directory and not in xdoclet/packagedir/of/my/bean/ as stated in the documentation (or did I interprete the docs wrong?)