ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » PCFMessageAgent.send returns MQRC_NOT_AUTHORIZED Error

Post new topic  Reply to topic
 PCFMessageAgent.send returns MQRC_NOT_AUTHORIZED Error « View previous topic :: View next topic » 
Author Message
ekoks
PostPosted: Thu Mar 31, 2016 6:20 am    Post subject: PCFMessageAgent.send returns MQRC_NOT_AUTHORIZED Error Reply with quote

Newbie

Joined: 22 Feb 2016
Posts: 5

Hello,

I'm writing a .NET application which requires s list of queues in a specific queuemanager.
However when I use PCFMessageAgent to send the request for the Q names, I receive an error MQRC_NOT_AUTHORISED.

My code:
Code:

        Try
            PCFMessageAgent = New PCF.PCFMessageAgent("APOLLOP")

            attrs = {MQC.MQCA_Q_NAME, MQC.MQCA_Q_DESC,
                    MQC.MQIA_CURRENT_Q_DEPTH,
                    MQC.MQIA_Q_TYPE,
                    MQC.MQCA_REMOTE_Q_MGR_NAME,
                    MQC.MQCA_REMOTE_Q_NAME}
            requestMessage = New PCF.PCFMessage(PCF.CMQCFC.MQCMD_INQUIRE_Q_NAMES)
            requestMessage.AddParameter(New PCF.MQCFST(MQC.MQCA_Q_NAME, "APOLLO.0001.LQ"))
            requestMessage.AddParameter(New PCF.MQCFIN(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL))
            requestMessage.AddParameter(New PCF.MQCFIL(PCF.CMQCFC.MQIACF_Q_ATTRS, attrs))


            response = PCFMessageAgent.Send(requestMessage)
            qNames = response(0).GetStringListParameterValue(MQC.MQCACF_Q_NAMES)

            For i = 0 To qNames.Length - 1
                System.Console.WriteLine("Queue " & i & " :  " & qNames(i))
            Next
        Catch e As Exception

            Console.WriteLine("Exception Occurred: MQ Error - " & e.Message)
        End Try


A colleague of me wrote a Java program with the Java Class library on the same queue manager and he isn't getting any error.

It seems that the .NET library is working slightly different than the Java library

Anybody any idea ?

The queuemanager error log states that I need the INQ permission to inquire the Q names. However, the Java version is working with the sames user on the same Q manager.

AMQERR01.LOG:
AMQ8077: Entity 'ek90698@nedcar' has insufficient authority to access object
'SYSTEM.DEFAULT.MODEL.QUEUE'.

EXPLANATION:
The specified entity is not authorized to access the required object. The
following requested permissions are unauthorized: inq
ACTION:
Ensure that the correct level of authority has been set for this entity against
the required object, or ensure that the entity is a member of a privileged
group.

Please help.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Mar 31, 2016 6:30 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The error is clear. The user in question doesn't have the permissions needed.

It's likely that the Java program is not supplying any user at all.

It's a much better idea to apply channel security and user mapping than to grant permissions to the user in question.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
hughson
PostPosted: Tue May 03, 2016 1:07 am    Post subject: Re: PCFMessageAgent.send returns MQRC_NOT_AUTHORIZED Error Reply with quote

Padawan

Joined: 09 May 2013
Posts: 1914
Location: Bay of Plenty, New Zealand

ekoks wrote:
The queuemanager error log states that I need the INQ permission to inquire the Q names. However, the Java version is working with the sames user on the same Q manager.

AMQERR01.LOG:
AMQ8077: Entity 'ek90698@nedcar' has insufficient authority to access object
'SYSTEM.DEFAULT.MODEL.QUEUE'.

EXPLANATION:
The specified entity is not authorized to access the required object. The
following requested permissions are unauthorized: inq
ACTION:
Ensure that the correct level of authority has been set for this entity against
the required object, or ensure that the entity is a member of a privileged
group.
Be very clear, the queue manager error log is reporting a problem about your access to the reply queue, and not about the authorization to issue the PCF command. In order to create a temporary dynamic reply queue (to receive the response messages from the command server which list the queue you are PCF Inquiring) your application is first opening the model queue SYSTEM.DEFAULT.MODEL.QUEUE which is the way to create the temporary dynamic queue. This action would normally only require DSP and GET authority.

ekoks wrote:
A colleague of me wrote a Java program with the Java Class library on the same queue manager and he isn't getting any error.

It seems that the .NET library is working slightly different than the Java library.

I agree that it seems the .NET library is also trying to do an MQINQ on the model queue, perhaps there is some additional information that those libraries required that the Java equivalent did not use.

Since you are using these wrapper functions, PCFMessageAgent, you do not have complete control over these things. There are two options for you.
  1. Grant the INQ authority to that one model queue that is being used for the reply queue. This is not a big exposure.
  2. Raise a PMR with IBM to ask them why there is a difference.

Cheers
Morag
_________________
Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » PCFMessageAgent.send returns MQRC_NOT_AUTHORIZED Error
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.