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: [email protected]

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.

_______________________________________________
rules-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to