tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ittay Dror <itt...@qlusters.com>
Subject problems setting up jaas
Date Tue, 30 Aug 2005 08:03:13 GMT
I'm using Tomcat 5.5 and want to setup JAAS based authentication. I'm using 
jbosssx for the LoginModule implementations.

The jboss implementation is activated when I try to login, but throws a 
NameNotFoundException:
javax.security.auth.login.LoginException: javax.naming.NameNotFoundException: 
Name QrmDS is not bound in this Context

Thanx for your help,
Ittay

my server.xml is:
....
<GlobalNamingResources>

     <!-- Test entry for demonstration purposes -->
     <Environment name="simpleValue" type="java.lang.Integer" value="30"/>

     <!-- Editable user database that can also be used by
          UserDatabaseRealm to authenticate users -->
          <Resource name="UserDatabase" auth="Container"
               type="org.apache.catalina.UserDatabase"
        description="User database that can be updated and saved"
            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
           pathname="conf/tomcat-users.xml" />

          <Resource name="QrmDS" auth="Container" type="javax.sql.DataSource"
                maxActive="30" maxIdle="5" maxWait="15"
                username="qrm" password="qrm_99" 
driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/qrm"
                 zeroDateTimeBehavior="convertToNull" useServerPrepStmts="false"
                 autoReconnect="true" failOverReadOnly="false"
         />


   </GlobalNamingResources>
....
  <!-- Define the top level container in our container hierarchy -->
     <Engine name="Catalina" defaultHost="localhost">

	<Realm className="org.apache.catalina.realm.JAASRealm" debug="99"
	   appName="qrm"
         	userClassNames="org.jboss.security.SimplePrincipal"
	        roleClassNames="org.jboss.security.SimpleGroup"
	/>
....

and this is my jaas.config:
qrm
{
         org.jboss.security.auth.spi.DatabaseServerLoginModule required debug=true
         dsJndiName="java:/QrmDS"
         principalsQuery="select user_password from qrm_users where user_name=?"
         rolesQuery="select qrm_roles.role_name, 'Roles' from 
qrm_users,qrm_roles,qrm_users_roles where user_name=? and qrm_users.id = 
qrm_users_roles.user_id and qrm_roles.id = qrm_users_roles.role_id"
         unauthenticatedIdentity="guest";
};

client-login {
         org.jboss.security.ClientLoginModule required;
};

-- 
===================================
Ittay Dror (ittayd@qlusters.com)
Application Team Leader, R&D
Qlusters Inc.
+972-3-6081994 Fax: +972-3-6081841

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message