PROPID_Q_AUTHENTICATE
Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista
(Optional.) The PROPID_Q_AUTHENTICATE property specifies whether or not the queue accepts only authenticated messages.
Property ID
PROPID_Q_AUTHENTICATE
Type Indicator
VT_UI1
MQPROPVARIANT Field
bVal
Property Value
This property can be set to one of the following values:
MQ_AUTHENTICATE_NONE
The default. The queue accepts authenticated and non-authenticated messages.
MQ_AUTHENTICATE
The queue only accepts authenticated messages.
Remarks
PROPID_Q_AUTHENTICATE is used to enforce authentication at the level of the queue. When this property is set to MQ_AUTHENTICATE, messages are rejected by the queue if the sending application did not request authentication. For information on how Message Queuing authenticates messages, see Message Authentication.
Note
The authentication level of a message, on the other hand, is set by PROPID_M_AUTH_LEVEL.
When a message is rejected the message packet is destroyed. However, if the sending application has requested negative acknowledgment messages an acknowledgment message with the message class MQMSG_CLASS_NACK_BAD_SIGNATURE is returned to the sending application to indicate the message was rejected by the queue. For information on negative acknowledgments, see Acknowledgment Messages.
To set the authentication level when creating a queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure and call MQCreateQueue.
To set the authentication level of an existing queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure and call MQSetQueueProperties. When changing the authentication level of the queue, the new setting impacts only arriving messages; it does not affect messages already in the queue.
To retrieve the authentication level of an existing queue, specify PROPID_Q_AUTHENTICATE in the MQQUEUEPROPS structure, and then call MQGetQueueProperties and examine its returned value.
The receiving application can also determine if a message was authenticated by checking the PROPID_M_AUTHENTICATED or PROPID_M_AUTHENTICATED_EX properties of the message.
When retrieving this property, the type indicator can be set to VT_UI1 or VT_NULL. If you set the type indicator equal to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI1 during the function call.
Equivalent COM Property
When using COM components, the authentication level of the queue can be set and retrieved using the MSMQQueueInfo.Authenticate property.
Example Code
The following code fragments show how PROPID_Q_AUTHENTICATE is specified in arrays that can be used to initialize an MQQUEUEPROPS structure for setting and retrieving the authentication level of a queue.
To Set the Authentication Level
aQueuePropID[i] = PROPID_Q_AUTHENTICATE; // Property identifier
aQueuePropVar[i].vt = VT_UI1; // Type indicator
aQueuePropVar[i].bVal = MQ_AUTHENTICATE; // Authentication level of queue
i++;
To Retrieve the Authentication Level
aQueuePropID[i] = PROPID_Q_AUTHENTICATE; // Property identifier
aQueuePropVar[i].vt = VT_NULL; // Type indicator
i++;
The following examples are included in Using Message Queuing.
For an example of | See |
---|---|
Creating a public or private queue | C/C++ Code Example: Creating a Queue |
Setting and retrieving the authentication level of an existing queue | C/C++ Code Example: Setting PROPID_Q_AUTHENTICATE C/C++ Code Example: Retrieving PROPID_Q_AUTHENTICATE |
See Also
Queue Properties
MQCreateQueue
MQGetQueueProperties
MQQUEUEPROPS
MQSetQueueProperties
PROPID_M_AUTH_LEVEL
PROPID_M_AUTHENTICATED