mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-10-30 02:12:32 +00:00
Framework update.
This commit is contained in:
@@ -63,8 +63,6 @@ namespace OpenWifi {
|
||||
auto refreshToken = GetS("refresh_token", Obj);
|
||||
auto grant_type = GetParameter("grant_type");
|
||||
|
||||
std::cout << __LINE__ << std::endl;
|
||||
|
||||
Poco::toLowerInPlace(userId);
|
||||
|
||||
if(!refreshToken.empty() && grant_type == "refresh_token") {
|
||||
@@ -78,7 +76,6 @@ namespace OpenWifi {
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << __LINE__ << std::endl;
|
||||
if(GetBoolParameter(RESTAPI::Protocol::REQUIREMENTS, false)) {
|
||||
Logger_.information(fmt::format("POLICY-REQUEST({}): Request.", Request->clientAddress().toString()));
|
||||
Poco::JSON::Object Answer;
|
||||
@@ -87,7 +84,6 @@ namespace OpenWifi {
|
||||
Answer.set(RESTAPI::Protocol::PASSWORDPOLICY, AuthService()->GetPasswordPolicy());
|
||||
return ReturnObject(Answer);
|
||||
}
|
||||
std::cout << __LINE__ << std::endl;
|
||||
|
||||
if(GetBoolParameter(RESTAPI::Protocol::FORGOTPASSWORD,false)) {
|
||||
SecurityObjects::UserInfo UInfo1;
|
||||
@@ -117,7 +113,6 @@ namespace OpenWifi {
|
||||
return ReturnObject(ReturnObj);
|
||||
}
|
||||
}
|
||||
std::cout << __LINE__ << std::endl;
|
||||
|
||||
if(GetBoolParameter(RESTAPI::Protocol::RESENDMFACODE,false)) {
|
||||
Logger_.information(fmt::format("RESEND-MFA-CODE({}): Request for {}", Request->clientAddress().toString(), userId));
|
||||
@@ -128,7 +123,6 @@ namespace OpenWifi {
|
||||
}
|
||||
return UnAuthorized(RESTAPI::Errors::InvalidCredentials, BAD_MFA_TRANSACTION);
|
||||
}
|
||||
std::cout << __LINE__ << std::endl;
|
||||
|
||||
if(GetBoolParameter(RESTAPI::Protocol::COMPLETEMFACHALLENGE,false)) {
|
||||
Logger_.information(fmt::format("COMPLETE-MFA-CHALLENGE({}): Request for {}", Request->clientAddress().toString(), userId));
|
||||
@@ -142,13 +136,11 @@ namespace OpenWifi {
|
||||
}
|
||||
return UnAuthorized(RESTAPI::Errors::InvalidCredentials, MFA_FAILURE);
|
||||
}
|
||||
std::cout << __LINE__ << std::endl;
|
||||
|
||||
SecurityObjects::UserInfoAndPolicy UInfo;
|
||||
bool Expired=false;
|
||||
auto Code=AuthService()->Authorize(userId, password, newPassword, UInfo, Expired);
|
||||
if (Code==SUCCESS) {
|
||||
std::cout << __LINE__ << std::endl;
|
||||
Poco::JSON::Object ReturnObj;
|
||||
if(AuthService()->RequiresMFA(UInfo)) {
|
||||
if(MFAServer()->StartMFAChallenge(UInfo, ReturnObj)) {
|
||||
|
||||
@@ -2040,13 +2040,11 @@ namespace OpenWifi {
|
||||
|
||||
inline void ProcessOptions() {
|
||||
// try to figure out if we are doing a CORS options or plain OPTIONS
|
||||
std::cout << __LINE__ << " : process_options" << std::endl;
|
||||
AddCORS();
|
||||
Response->set("Vary", "Origin, Access-Control-Request-Headers, Access-Control-Request-Method");
|
||||
SetCommonHeaders();
|
||||
Response->set("Access-Control-Allow-Credentials", "true");
|
||||
Response->setContentLength(0);
|
||||
// Response->setStatus(Poco::Net::HTTPResponse::HTTP_NO_CONTENT);
|
||||
Response->setStatus(Poco::Net::HTTPResponse::HTTP_OK);
|
||||
Response->send();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user