diff --git a/src/client/requestbroker/APIRequest.cpp b/src/client/requestbroker/APIRequest.cpp index aa42f1067..6685b428e 100644 --- a/src/client/requestbroker/APIRequest.cpp +++ b/src/client/requestbroker/APIRequest.cpp @@ -97,7 +97,6 @@ RequestBroker::ProcessResponse APIRequest::Process(RequestBroker & rb) if(Client::Ref().GetAuthUser().ID) { - std::cout << typeid(*this).name() << " Authenticated " << std::endl; User user = Client::Ref().GetAuthUser(); char userName[12]; char *userSession = new char[user.SessionID.length() + 1]; @@ -115,6 +114,16 @@ RequestBroker::ProcessResponse APIRequest::Process(RequestBroker & rb) else { HTTPContext = http_async_req_start(NULL, (char *)URL.c_str(), NULL, 0, 0); + if(Client::Ref().GetAuthUser().ID) + { + User user = Client::Ref().GetAuthUser(); + char userName[12]; + char *userSession = new char[user.SessionID.length() + 1]; + std::strcpy(userName, format::NumberToString(user.ID).c_str()); + std::strcpy(userSession, user.SessionID.c_str()); + http_auth_headers(HTTPContext, userName, NULL, userSession); + delete userSession; + } } //RequestTime = time(NULL); } diff --git a/src/client/requestbroker/WebRequest.cpp b/src/client/requestbroker/WebRequest.cpp index fffdcc804..532cda712 100644 --- a/src/client/requestbroker/WebRequest.cpp +++ b/src/client/requestbroker/WebRequest.cpp @@ -114,6 +114,16 @@ RequestBroker::ProcessResponse WebRequest::Process(RequestBroker & rb) else { HTTPContext = http_async_req_start(NULL, (char *)URL.c_str(), NULL, 0, 0); + if(Client::Ref().GetAuthUser().ID) + { + User user = Client::Ref().GetAuthUser(); + char userName[12]; + char *userSession = new char[user.SessionID.length() + 1]; + std::strcpy(userName, format::NumberToString(user.ID).c_str()); + std::strcpy(userSession, user.SessionID.c_str()); + http_auth_headers(HTTPContext, userName, NULL, userSession); + delete userSession; + } } } return RequestBroker::OK;