[jboss-user] [Security & JAAS/JBoss] - Authentication problem with JBoss 4.2.3

jbarajas do-not-reply at jboss.com
Fri Sep 19 10:33:58 EDT 2008


I'm using JBoss 4.2.3 with Oracle 9. 
I followed all process description that is in http://wiki.jboss.org/wiki/ConfigJBossMQDB. This is all what I've done:

* I put the jars I need in $JBOSS_HOME/server/default/lib

* In $JBOSS_HOME/server/default/deploy/jsm is oracle-ds.xml file with datasource details: 


  <local-tx-datasource>
    <jndi-name>OracleDS</jndi-name>
    <connection-url>jdbc:oracle:thin:@10.1.0.21:1521:univ9id</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>clife</user-name>
    oracle
    <type-mapping>Oracle8</type-mapping>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
  </local-tx-datasource>


* Removed the $JBOSS_HOME/server/default/deploy/jms/hsqldb-ds.xml file

* In $JBOSS_HOME/server/default/deploy/jms/oracle-jdbc2-service.xml
put this tags:

  
    <depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=OracleDS

* Removed the $JBOSS_HOME/server/fecault/deploy/jms/hsqldb-jdbc2-service.xml file

* In $JBOSS_HOME/server/default/config/login-config.xml add this tags for security domain:

	<!-- Security domain for JBossMQ -->
	<application-policy name = "jbossmq">
       
          <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
             flag = "required">
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "dsJndiName">java:/OracleDS</module-option>
             <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
             <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
          </login-module>
       
    </application-policy> 

* In $JBOSS_HOME/server/default/deploy/ejb-deployer.xml to update the time service modified this tag:

    <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=OracleDS

* In $JBOSS_HOME/server/default/uuid-key-generator/META-INF/jboss-service.xml to update the HiLo Generator Service add my defined datasource:

<depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=OracleDS

* Too in $JBOSS_HOME/server/all/deploy/juddi-service.sar/META-INF/jboss-service.xml add my datasource:

jboss.jca:service=DataSourceBinding,name=OracleDS

And the last, in $JBOSS_HOME/server/default/conf/jbossmq-state.xml I've defined the users and roles for my application. This is a test with just 1 user and this file looks like:

< ?xml version="1.0" encoding="UTF-8"?>
< StateManager>
< Users>
	< User>
		< Name>archivo_piso_1_1< /Name>
		< Password>archivo< /Password>
		< Id>impresionClientPiso1< /Id>
	< /User>
< /Users>

< Roles>
	< Role name="guest">
	     < UserName>archivo_piso_1_1
                < /Role>
	< Role name="subscriber">
	    < UserName>archivo_piso_1_1< /UserName>
	< / Role>
	< Role name="publisher">
	    < UserName>archivo_piso_1_1
	< /Role>
	< Role name="durpublisher">
	    < UserName>archivo_piso_1_1< /UserName>
	< /Role>
	< Role name="noacc">
	    < UserName>nobody< /UserName>
	< /Role>


< DurableSubscriptions>
	< DurableSubscription>
	   < ClientID>impresionClientPiso1< /ClientID>
	   < Name>impresion_client< /Name>
	   < TopicName>testDurableTopic< /TopicName>
	< /DurableSubscription>
< /DurableSubscriptions>
< /StateManager>

The problem that appears when I try to execute my process is: 'Exception in thread "main" javax.jms.JMSSecurityException: User: archivo_piso_1_1 is NOT authenticated' and it looks like this:

init:
     [echo] Using jboss.dist=C:/framework/jboss-4.2.3.GA
     [echo] Using src.dir=C:\ClearCase\jbarajas_ArchivoWebp\ArchivoWebv\workspace\cvs_filesAlll\jmsClients/src/main
     [echo] Using basedir=C:\ClearCase\jbarajas_ArchivoWebp\ArchivoWebv\workspace\cvs_filesAlll\jmsClients

compile:

setup:
     [java] Begin DurableTopicSetup
     [java] [DEBUG,SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
     [java] [DEBUG,SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory[server=org.jboss.mq.il.uil2.U
     [java] [DEBUG,Connection] Setting the clockDaemon's thread factory
     [java] [DEBUG,SocketManager] Begin ReadTask.run Thread[UIL2.SocketManager.ReadTask#1 client=127.0.0.1:8093,5,JBossMQ Client Threads]
     [java] [DEBUG,SocketManager] Begin WriteTask.run Thread[UIL2.SocketManager.WriteTask#2 client=127.0.0.1:8093,5,JBossMQ Client Threads]
     [java] [DEBUG,SocketManager] Created ObjectOutputStream
     [java] [DEBUG,SocketManager] Created ObjectInputStream
     [java] [DEBUG,SocketManager] End ReadTask.run Thread[UIL2.SocketManager.ReadTask#1 client=127.0.0.1:8093,5,JBossMQ Client Threads]
     [java] [DEBUG,SocketManager] End WriteTask.run Thread[UIL2.SocketManager.WriteTask#2 client=127.0.0.1:8093,5,JBossMQ Client Threads]
     [java] Exception in thread "main" javax.jms.JMSSecurityException: User: archivo_piso_1_1 is NOT authenticated
     [java]     at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.java:230)
     [java]     at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSecurityInterceptor.java:66)
     [java]     at org.jboss.mq.server.TracingInterceptor.authenticate(TracingInterceptor.java:613)
     [java]     at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.java:172)
     [java]     at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:238)
     [java]     at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:419)
     [java]     at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
     [java]     at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:756)
     [java]     at java.lang.Thread.run(Thread.java:595)
     [java] Java Result: 1

I've read many documentation about JBossMQ, MQSecurity, MQDB and tried many solutions but still I have the same problem. I don't know if I have to define the users in other file too or what other files I have to update or modify.

Please, I need help to resolve this problem, any kind of help I'll be glad and really appreciate. Thanks in advance.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4177692#4177692

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4177692



More information about the jboss-user mailing list