Revert "Auth methods configuration"
This reverts commit 0ff64dc2cd3a15b4204a477ad2eb5219d66e6110.
Reason for revert: <breaks redfish validator, <edmx:Reference Uri="/redfish/v1/schema/OemAccountService_v1.xml"> but the file name unversioned static/redfish/v1/schema/OemAccountService.xml>
Change-Id: I696dd09bf519e364f5f529a674e047a8eeead578
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp
index 7e4e3bb..0a44050 100644
--- a/include/token_authorization_middleware.hpp
+++ b/include/token_authorization_middleware.hpp
@@ -31,15 +31,8 @@
return;
}
- const crow::persistent_data::AuthConfigMethods& authMethodsConfig =
- crow::persistent_data::SessionStore::getInstance()
- .getAuthMethodsConfig();
-
- if (req.session == nullptr && authMethodsConfig.xtoken)
- {
- req.session = performXtokenAuth(req);
- }
- if (req.session == nullptr && authMethodsConfig.cookie)
+ req.session = performXtokenAuth(req);
+ if (req.session == nullptr)
{
req.session = performCookieAuth(req);
}
@@ -49,13 +42,11 @@
if (!authHeader.empty())
{
// Reject any kind of auth other than basic or token
- if (boost::starts_with(authHeader, "Token ") &&
- authMethodsConfig.sessionToken)
+ if (boost::starts_with(authHeader, "Token "))
{
req.session = performTokenAuth(authHeader);
}
- else if (boost::starts_with(authHeader, "Basic ") &&
- authMethodsConfig.basic)
+ else if (boost::starts_with(authHeader, "Basic "))
{
req.session = performBasicAuth(authHeader);
}