There are a few different steps to get JAAS Auth to work in
JBoss:
LOGIN CODE
-------------------
JBOSS EJB_DESCRIPTOR INFO
---------------------------------------------
JBOSS CONFIGURATIONS
------------------------------------
NEEDED TO COMPILE AND RUN CLIENT
---------------------------------------------------------
NOTE: you will need these jars for BOTH compiling AND running THE CLIENT
//ALL CLIENT JARS
${JBOSS_HOME}/client/*.jar
//THIS IS THE KEY!!! THIS IS THE JAR THEY DON'T TELL YOU
//ABOUT, BUT THAT HAS THE JAAS CLASSES!!!
${JBOSS_HOME}/server/all/lib/jbosssx.jar
RUNTIME SYSTEM PROPERTIES FOR CLIENT - REQUIRED
----------------------------------------------------------------
//NOTE: ALL THESE ARE FOR RUNNING THE CLIENT!!!
-Djava.security.manager
//I WILL GIVE YOU WHAT THIS FILE MUST CONTAIN
-Djava.security.auth.login.config=auth.conf
//I WILL GIVE YOU A SAMPLE OF THIS, JUST FOR
TESTING -Djava.security.policy=ourtest.policy
-Djava.security.auth.policy=ourtest.policy
CONFIG FILE (FOR CLIENT): auth.conf
------------------------------------------------------
POLICY FILE (FOR CLIENT): ourtest.policy
-----------------------------------------------------------
OK, I believe that's all you need! I think that the class for using a properties file for a login usernames/passwords is: org.jboss.security.ClientLoginModule. So if you don't want to use the database for your tests, replace all the DB Module classes listed in the files above with this one.
OK, I spent
alot of time putting this together because i know it stinks to not be able to find it anywhere. i went through it myself and i don't want anyone else to be frustrated. All I ask is this:
1. Anytime you are searching for the answer to how to do something and alot of people also want to know, and then you come up with the answer - POST IT!!
2. I need to know how to use resource-env-ref or resource-ref with Jetty (only Jetty). Anyone who knows, please post it for me! Thanks!
Robert
[ January 27, 2003: Message edited by: Robert Paris ]
[ January 17, 2004: Message edited by: Robert Paris ]