3 Replies Latest reply on Aug 6, 2002 11:23 PM by jameschaingchen

    username and password

    brs_marc

      Hi all... im new to JBoss so i need a little help...

      Im trying to setup a basic security login for a couple of jsp pages, i used to do it with tomcat4.0.3 stand alone and it worked fine but now i want to do it with jboss...

      heres what i have so far...

      in my web.xml file

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>cusdisplay</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>promocustomerdisplay</role-name>
      </auth-constraint>
      </security-constraint>


      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Alicou</realm-name>
      </login-config>

      <security-role>
      <role-name>promocustomerdisplay</role-name>
      </security-role>

      and in the jboss-web.xml file

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

      where do i set the users and passwords, i tried in a properties file like i saw in the online manual but doesnt seem to work....

      So what am i doing wrong or how should i do this....

      THANX.....


        • 1. Re: username and password
          sharkman

          Look here for an example on how to secure your ejbs.
          http://www.javaworld.com/javaworld/jw-08-2001/jw-0831-jaas.html

          • 2. Re: username and password
            brs_marc

            Thanks for the link sharkman, i read the whole doc i applied new changes but it still doesnt work...

            The only thing that I need for now is a simple login just like tomcat stand alone does. I dont have any EJB's yet (i will in the future, thats why i switched from tomcat to jboss jboss-3.0.1RC1_tomcat-4.0.4) so i just need the basic login... In tomcat i used to set a <security-constraint> in the web.xml file and that would be it, is there something simple like that in JBoss or do i realy have to code my own security procedure?

            THANX....

            • 3. Re: username and password
              jameschaingchen

              Try jboss-2.4.4. The sample code in the cited article on JavaWorld only works for jboss-2.4.x_tomcat-3.2.3. The same code doesn't work for jboss-3.0.x. If someone knows how to get it work for 3.0.x, I would appreciate that he can post the details.

              James