[rules-dev] Guvnor JAAS authentification with Tomcat

mamadou.ensi mohamed.ensi at gmail.com
Thu May 20 07:35:48 EDT 2010


Hi,

I will explain how to configure JAAS authentification for Guvnor using
Tomcat 

Lets start,

1/ We should have a JAAS LoginModule implemented that connect to a database
and test if the user exists in the database.

for example:
public class JaasGuvnor implements LoginModule {
public String userName;
public String password;
public boolean login(){
return true if user exist and false if not
}
/*other methods to implement*/
}

2/ open %TOMCAT_HOME%/conf/context.xml and you should configure your
database, here I use Oracle
<Resource name="jdbc/URDroolsDS"

            auth="Container"

            type="javax.sql.DataSource"

            driverClassName="oracle.jdbc.OracleDriver"

            url="jdbc:oracle:thin:@mamadou:1522:guvnor"

            username="drools"

            password="drools"

            maxActive="20"

            maxIdle="10"

            maxWait="-1"/>

    <Realm  className="org.apache.catalina.realm.JAASRealm"                

        appName="drools-guvnor"      

        userClassNames="com.test.User"      

        roleClassNames="com.test.Role"

        useContextClassLoader="false"/>

3/ add a file jaas.config on %TOMCAT_HOME%/conf
drools-guvnor{

  com.test.JaasGuvnor required debug=true;

};

4/ Before lunching Tomcat we add “set JAVA_OPTS=-Xmx256m
-Djava.security.auth.login.config=%CATALINA_HOME%/conf/jaas.config” 

For more information contact me: mohamed.ensi at gmail.com

Regards
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-JAAS-authentification-with-Tomcat-tp831582p831582.html
Sent from the Drools - Dev mailing list archive at Nabble.com.



More information about the rules-dev mailing list