I searched this forum but didn't find any example so here is my problem:

I've got the JBoss Messaging installed/converted all okay, test QueueExample 
worked fine with no user security checking. I've modified the properties file 
used by the messaging security domain and added additional users / roles. Now, 
the question is, how do I specify the username and password from the client 
program?

I tried adding the following to the QueueExample:

  |                     java.util.Hashtable env = new java.util.Hashtable();
  |                     env.put(Context.SECURITY_PRINCIPAL, "user");
  |                     env.put(Context.SECURITY_CREDENTIALS, "pass4user");
  |                     env.put(Context.INITIAL_CONTEXT_FACTORY, 
"org.jboss.security.jndi.JndiLoginInitialContextFactory");
  | 
  |                ic = new InitialContext();
  | 
And that generates error:
javax.jms.JMSSecurityException: User: null is not authorized to write to 
destination testQueue

The messaging-users.properties file:

  | admin=pass4admin
  | user=pass4user
  | guest=guest
  | 

The messaging-roles.properties file:
admin=admin
  | user=user
  | guest=guest
  | 

And the messaging-service.xml file:

  |       <attribute name="SecurityDomain">java:/jaas/messaging</attribute>
  |       <attribute name="DefaultSecurityConfig">
  |         <security>
  |             <role name="admin" read="true" write="true" create="true"/>
  |             <role name="user" read="true" write="true" create="true"/>
  |         </security>
  |       </attribute>
  | 

As you can see, I removed the "guest" role from the the message-service.xml 
security settings. If I put the guest back, it worked just fine.

So any idea what I am doing wrong?

Thanks in advance.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3999204
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to