6 Replies Latest reply on Jul 22, 2009 4:51 AM by desuraghu

    Exception during message publsih

    desuraghu

      I have configured my own security config for a topic.

      When i am trying to publish a message on that topic i m getting the following exception. Can any one help in resolving this problem.

      I have configured security config in destination-service.xml file.


      2009-07-21 23:51:33,078 TRACE [org.jboss.jms.server.security.SecurityMetadataStore] authenticating user internalApplication
      2009-07-21 23:51:33,078 TRACE [org.jboss.jms.server.security.SecurityMetadataStore] authorizing user internalApplication for role(s) [ApplicationUserRole]
      2009-07-21 23:51:33,078 TRACE [org.jboss.jms.server.security.SecurityMetadataStore] user internalApplication is NOT authorized
      javax.jms.JMSSecurityException: User: internalApplication is not authorized to write to destination eventTopic
      at org.jboss.jms.server.container.SecurityAspect.check(SecurityAspect.java:312)
      at org.jboss.jms.server.container.SecurityAspect.handleSend(SecurityAspect.java:155)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:121)
      at org.jboss.jms.server.endpoint.advised.SessionAdvised$send_7280680627620114891.invokeNext(SessionAdvised$send_7280680627620114891.java)

        • 1. Re: Exception during message publsih
          clebert.suconic

          The Security Meta Store is forbiding the authorization for some reason.

          Double check your configs. Or you could also provide more details about your config then we could help.

          You could also try adding debug/Trace at org.jboss.jms.server.security and the Security store you are using, and take a look on the logs.

          • 2. Re: Exception during message publsih
            desuraghu

            In the destnation service.xml file I have added the following config for the topic.

            <attribute name="SecurityConfig">
             <security>
             <role name="ApplicationUserRole" read="true" write="true" create="true"/>
             </security>
             </attribute>
            

            In the message-service.xml file also i have specified the security conf in the follwing way:
            <attribute name="DefaultSecurityConfig">
             <security>
             <role name="ApplicationUserRole" read="true" write="true" create="true"/>
             </security>
             </attribute>
            
            
            
            In login-config.xml file:
            <application-policy name = "messaging">
             <authentication>
             <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
             <module-option name = "unauthenticatedIdentity">guest</module-option>
             <module-option name = "usersProperties">props/messaging-users.properties</module-option>
             <module-option name = "rolesProperties">props/messaging-roles.properties</module-option>
             </login-module>
             </authentication>
             </application-policy>
            

            Added the mapping in user.properties and role.properties file.

            • 3. Re: Exception during message publsih
              desuraghu

               

              "desuraghu" wrote:
              In the destnation service.xml file I have added the following config for the topic.

              <!--
              <attribute name="SecurityConfig">
              <security>
              <role name="ApplicationUserRole" read="true" write="true" create="true"/>
              </security>
              </attribute>
              -->
              In the message-service.xml file also i have specified the security conf in the follwing way:

              <attribute name="DefaultSecurityConfig">
              <security>
              <role name="ApplicationUserRole" read="true" write="true" create="true"/>
              </security>
              </attribute>



              In login-config.xml file:
              <application-policy name = "messaging">
              <authentication>
              <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
              <module-option name = "unauthenticatedIdentity">guest</module-option>
              <module-option name = "usersProperties">props/messaging-users.properties</module-option>
              <module-option name = "rolesProperties">props/messaging-roles.properties</module-option>
              </login-module>
              </authentication>
              </application-policy>

              Added the mapping in user.properties and role.properties file.


              • 4. Re: Exception during message publsih
                desuraghu

                 

                "desuraghu" wrote:
                "desuraghu" wrote:
                In the destnation service.xml file I have added the following config for the topic.

                <security>
                <role name="ApplicationUserRole" read="true" write="true" create="true"/>
                </security>

                In the message-service.xml file also i have specified the security conf in the follwing way:

                <security>
                <role name="ApplicationUserRole" read="true" write="true" create="true"/>
                </security>



                In login-config.xml file:
                <application-policy name = "messaging">
                <authentication>
                <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
                <module-option name = "unauthenticatedIdentity">guest</module-option>
                <module-option name = "usersProperties">props/messaging-users.properties</module-option>
                <module-option name = "rolesProperties">props/messaging-roles.properties</module-option>
                </login-module>
                </authentication>
                </application-policy>

                Added the mapping in user.properties and role.properties file.


                • 5. Re: Exception during message publsih
                  gaohoward

                  what's your jboss AS version and JBM version?

                  • 6. Re: Exception during message publsih
                    desuraghu

                    JBoss version - 4.2.2
                    JBM - 1.4.2