<div dir="ltr"><div>Hello!</div><div><br></div><div>Please advise, what is the proper handling of wrong credentials on logon in initiator?</div><div><br></div><div>
<div>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?</div><div><br></div>

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...</div><div><br></div><div>So, my questions are:<br></div><div>1. To handle invalid username/password

- is it correct to catch "logout" (MsgType=5) messages in "FromEarlyIntercept"?</div><div>(Also it implies having a flag that logon is in progress, to distinguish "wrong credentials logout" from other scenarios...)<br></div><div><br></div><div>2. How to stop Initiator from logons with the wrong credentials - is calling the session's "Logout" 
a proper solution? <br></div><div><br></div><div>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></div><div><br></div><div>Thank you!</div><div>
<div><br></div><div>Best regards,</div><div>Pavel</div><div><br></div>

</div><div>public void Connect(..)</div><div>{</div><div>    ...</div><div>    _connecting = true;</div><div>    _initiator.Start();</div><div>    ....<br></div><div>}</div><div><br></div><div>...<br></div><div><br></div><div>public void FromEarlyIntercept(Message msg, SessionID sessionID)<br>{</div><div>    if (_connecting)</div><div>    {<br></div><div>        string msgType = msg.Header.GetField(Tags.MsgType);</div><div>        switch (msgType)<br>        {</div><div>            case MsgType.LOGOUT: // Got logout when connecting - wrong credentials?<br></div><div>                Session.LookupSession(sessionID).Logout("Invalid credentials"); // Stop further logon attempts?<br></div><div>                <signal logon failure / wrong credentials to the Logon Window><br></div><div>                break;</div><div>            ...<br></div><div>        }</div><div>    }</div><div>   ...<br></div><div>}</div><div><br></div><div>public void OnLogon(SessionID sessionID)<br>{</div><div>    ...<br></div><div>    _connecting = false;</div><div>    ...<br></div><div>}</div><div>...</div><div><br></div></div>