Logon(A) Message

Purpose

Used to establish a connection between a FIX client and QST FIX server.

Message Direction

From QST FIX server to FIX client and from FIX client to QST FIX server

Supported tags

Note

Each Logon message should start with Standard Header component(with the tag 35 (MsgType) = A) and end with the Standard Trailer.

RawData - 96

Tag number

Field Name

Required

Data type

96

RawData

Y

data

Comments

Logon password The value must match the logon password for the FIX session. QST FIX server does not include this tag in its responses.


EncryptMethod - 98

Tag number

Field Name

Required

Data type

98

EncryptMethod

Y

int

Comments

Method of encryption As QST FIX server does not support encrypted logons, you must set the value to 0 (None/Other).


HeartBtInt - 108

Tag number

Field Name

Required

Data type

108

HeartBtInt

Y

int

Comments

Heartbeat interval (seconds)

Warning

The heartbeat interval can be set to maximum 14 (seconds).


ResetSeqNumFlag - 141

Tag number

Field Name

Required

Data type

141

ResetSeqNumFlag

Y

Boolean

Comments

Whether to reset the sequence numbers on both sides of the FIX session

Valid values include Y (dafault) and N (not supported).

Note

  • If a FIX client sends Y, it must also set tag 34 (MsgSeqNum) = 1.

  • We are resetting the SeqNum at every Logon.


Message Notes

The Logon (A) message is used by a FIX client to begin a new or continue an existing session with QST FIX server.

Note

When logging in to a Security Definition FIX session, a FIX client must always set 141 = Y and 34 = 1; otherwise, QST FIX server sends a Logout (5) message with the message: “MsgSeqNum must be set to 1 if ResetSeqNumFlag is set to Y” in tag 58 (Text).

The following data flow illustrates a typical logon sequence between QST FIX server and a FIX client for an order session:

  1. FIX client initiates a socket connection.

  2. FIX client sends a Logon (A) message to QST FIX server.

  3. QST FIX server receives the FIX client logon message and verifies the following tags in the Logon (A) message against the corresponding parameter values:

  • Tag 56 (TargetCompID) to LocalCompId (in QST User Setup)

  • Tag 96 (RawData) to Password (in QST User Setup)

  1. If any of the following errors occur, QST FIX server stops processing the logon attempt, sends the FIX Client a Logout (5) message with the reason for rejection in Tag 58 (Text), and closes the socket connection.

  • These tags do not match for the adapter and the client.

  • QST User Setup does not respond.

  • The QST universal login credentials (tags 49 and 96) are invalid.

  1. Examine the value of Tag 141 (ResetSeqNumFlag).

  • If Tag 141 (ResetSeqNumFlag) is set to N, QST FIX server compares the value of Tag 34 (MsgSeqNum) in the Logon (A) message against its current sequence number.

    • If MsgSeqNum is less than the expected sequence number, QST FIX server stops processing the logon attempt, sends a Logout (5) message as its response, and closes the socket connection.

    • If MsgSeqNum is greater than sequence number QST FIX server expected, the logon process continues normally. However, after the logon process completes, QST FIX server sends a Resend Request (2) message.

  • If Tag 141 (ResetSeqNumFlag) is set to Y, QST FIX server expects the value of Tag 34 (MsgSeqNum) in the Logon (A) message to be 1.

    • If Tag 34 is not 1, QST FIX server stops processing the logon attempt, sends a Logout (5) message, and closes the connection.

    • Otherwise, the logon process continues normally.

  1. QST FIX server sends a Logon (A) message to the FIX client.


Logon Failed Error Codes

When the Logon fails, you will receive a message that has this format: Login failed: ErrorCode. The ErrorCode can have one of the following values:

  • 1 - Invalid username or password.

  • 2 - Second factor missing, when 2fa authentication is enabled.

  • 5 - Too many failed login attempts.

  • 1000 - Login failed for any other reason

Note

If the client sends a Logon and the connection get’s closed, it means that the


Example

Logon Request from the client:

8=FIX.4.2|9=115|35=A|34=1|49=user|52=20210823-14:39:14.717|56=MYFIXSERVER|96=password|98=0|108=30|141=Y|30001=host|30002=127.0.0.1|10=122|

Succesful Logon response from QST server:

8=FIX.4.2|9=81|35=A|34=1|49=qst_qapinr|52=20210908-11:47:46.891716|56=user123|98=0|108=30|141=Y|10=227|

Failed Logon response from QST server(the connection will be closed):

8=FIX.4.2|9=106|35=5|34=1|49=qst_qapinr|52=20210908-11:52:18.876283|56=user123|58=Rejected Logon Attempt: Login failed: 1|10=014|