BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
fix_client::AuthManager Class Reference

A layer above FixClientSession that handles the 35=BE/BF credentials exchange. More...

#include <AuthManager.h>

Collaboration diagram for fix_client::AuthManager:
Collaboration graph

Public Types

using AuthCallback = std::function< void(bool success, const std::string &message)>
 

Public Member Functions

 AuthManager (std::shared_ptr< FixClientSession > session)
 
void authenticate (const std::string &username, const std::string &password, AuthCallback callback)
 Sends the 35=BE message and awaits response.
 
bool handleMessage (const ParsedFixMessage &parsed, const std::string &rawFix)
 Intercepts incoming messages looking for 35=BF.
 

Private Attributes

AuthCallback mPendingCallback
 
std::string mPendingReqId
 
std::shared_ptr< FixClientSessionmSession
 

Detailed Description

A layer above FixClientSession that handles the 35=BE/BF credentials exchange.

In BetaTrader, after the session is physically connected and Logged On (35=A), a client must still authenticate its trading account using a UserRequest (35=BE) before sending orders or subscribing to market data.

Member Typedef Documentation

◆ AuthCallback

using fix_client::AuthManager::AuthCallback = std::function<void(bool success, const std::string& message)>

Constructor & Destructor Documentation

◆ AuthManager()

fix_client::AuthManager::AuthManager ( std::shared_ptr< FixClientSession session)

Member Function Documentation

◆ authenticate()

void fix_client::AuthManager::authenticate ( const std::string &  username,
const std::string &  password,
AuthCallback  callback 
)

Sends the 35=BE message and awaits response.

Parameters
usernameAccount username
passwordAccount password
callbackFired when 35=BF is received.

◆ handleMessage()

bool fix_client::AuthManager::handleMessage ( const ParsedFixMessage parsed,
const std::string &  rawFix 
)

Intercepts incoming messages looking for 35=BF.

Returns
true if the message was handled by AuthManager, false if it should be passed to the application.
Here is the call graph for this function:

Member Data Documentation

◆ mPendingCallback

AuthCallback fix_client::AuthManager::mPendingCallback
private

◆ mPendingReqId

std::string fix_client::AuthManager::mPendingReqId
private

◆ mSession

std::shared_ptr<FixClientSession> fix_client::AuthManager::mSession
private

The documentation for this class was generated from the following files: