<html><head><title>Re: {{Quickfixn}} disconnecting: Received msg type '3' when not logged on</title>
</head>
<body>
<span style=" font-family:'Tahoma'; font-size: 12pt;">Hi Pavel,<br>
<br>
I have been working with QF for over a decade and I never knew this existed. It solved my problem, thank you!<br>
<br>
Francis<br>
<br>
-------------------------------------------------------------<br>
From: Pavel <</span><a style=" font-family:'tahoma'; font-size: 12pt;" href="mailto:pavka1799@gmail.com">pavka1799@gmail.com</a><span style=" font-family:'Tahoma'; font-size: 12pt;">><br>
To: "Mailing list for QuickFIX/n" <</span><a style=" font-family:'tahoma'; font-size: 12pt;" href="mailto:quickfixn@lists.quickfixn.com">quickfixn@lists.quickfixn.com</a><span style=" font-family:'Tahoma'; font-size: 12pt;">><br>
Date: Sunday, June 24, 2018, 6:24:10 AM<br>
Subject: {{Quickfixn}} disconnecting: Received msg type '3' when not logged on<br>
<br>
Hi Francis<br>
<br>
I can only re-post my own similar question with a potential solution based on "IApplicationExt.FromEarlyIntercept" handler (see below between ***** ), though there was no answer from QuickFix/n gurus.<br>
In your case you can add handling of MsgType.REJECT there...<br>
<br>
Regards,<br>
Pavel<br>
<br>
*****<br>
Please advise, what is the proper handling of wrong credentials on logon in initiator?<br>
<br>
At the start of application Logon window is displayed to prompt for user name + password, and in case of logon failure corresponding message should be displayed, prompting for correct input again. How is this scenario supported by QuickFix/n?<br>
<br>
In case username/password is wrong, QuickFix/n Initiator will keep on logon attempts, and I could not find any other handler of this situation but in "IApplicationExt.FromEarlyIntercept". Apparently no other handler is called in such a case, all logic is kept internally within the QuickFix/n engine - it just continues logon failures with the wrong password every <ReconnectInterval> seconds...<br>
<br>
So, my questions are:<br>
1. To handle invalid username/password - is it correct to catch "logout" (MsgType=5) messages in "FromEarlyIntercept"?<br>
(Also it implies having a flag that logon is in progress, to distinguish "wrong credentials logout" from other scenarios...)<br>
<br>
2. How to stop Initiator from logons with the wrong credentials - is calling the session's "Logout" a proper solution?<br>
<br>
3. The below code - does it look generally correct to handle invalid credentials in the client (initiator) app with a Logon window (assuming Connect() is called from the Logon window)?<br>
<br>
Thank you!<br>
<br>
Best regards,<br>
Pavel<br>
<br>
public void Connect(..)<br>
{<br>
...<br>
_connecting = true;<br>
_initiator.Start();<br>
....<br>
}<br>
<br>
...<br>
<br>
public void FromEarlyIntercept(Message msg, SessionID sessionID)<br>
{<br>
if (_connecting)<br>
{<br>
string msgType = msg.Header.GetField(Tags.MsgType);<br>
switch (msgType)<br>
{<br>
case MsgType.LOGOUT: // Got logout when connecting - wrong credentials?<br>
Session.LookupSession(sessionID).Logout("Invalid credentials"); // Stop further logon attempts?<br>
<signal logon failure / wrong credentials to the Logon Window><br>
break;<br>
...<br>
}<br>
}<br>
...<br>
}<br>
<br>
public void OnLogon(SessionID sessionID)<br>
{<br>
...<br>
_connecting = false;<br>
...<br>
}<br>
...<br>
<br>
<br>
*****<br>
<br>
On 20 June 2018 at 23:40, Francis Gingras <</span><a style=" font-family:'tahoma'; font-size: 12pt;" href="mailto:francis@collective2.com">francis@collective2.com</a><span style=" font-family:'Tahoma'; font-size: 12pt;">> wrote:<br>
Hi guys,<br>
<br>
Is there a configuration option that would let QF process a Reject as a response to a Logon message? This counterparty responds to failed auth with a reject but the message never makes it to the QF MessageCracker. I am using QF/n 1.8<br>
<br>
20180620-21:33:40.584 : Initiated logon request<br>
20180620-21:33:40.686 : Session FIX.4.2:blabla->Coinbase disconnecting: Received msg type '3' when not logged on<br>
<br>
20180620-21:33:40.584 : 8=FIX.4.2 9=178 35=A 34=1 49=blabla=20180620-21:33:40.567 56=Coinbase 96=superdupersecret 98=0 108=30 141=Y 554=notsosecret 8013=N 9406=Y 10=215<br>
20180620-21:33:40.677 : 8=FIX.4.2 9=128 35=3 52=20180620-21:33:40.468 49=Coinbase 56=blabla=1 45=1 58=invalid signature 371=96 372=A 373=5 10=193<br>
<br>
Thanks,<br>
<br>
Francis<br>
<br>
_______________________________________________<br>
Quickfixn mailing list<br>
</span><a style=" font-family:'tahoma'; font-size: 12pt;" href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br>
<a style=" font-family:'tahoma'; font-size: 12pt;" href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</body></html>