update 20241113

This commit is contained in:
Stefan Hutter
2024-11-13 17:55:15 +01:00
parent 09bcee5a2a
commit 1682465067
117 changed files with 346 additions and 148 deletions

View File

@@ -132,6 +132,10 @@ namespace SecuringWebApiUsingApiKey.Middleware
if (GetValue("AuthCheck") == "Yes")
{
apikeys = GetValue("APIKeys").ToString().Split(',');
for (int i = 0; i < apikeys.Length; i++)
{
apikeys[i] = apikeys[i].Replace(Environment.NewLine, "");
}
IEnumerable<KeyValuePair<string, string>> queryParams = request.GetQueryNameValuePairs();
var key = queryParams.FirstOrDefault(x => x.Key == "api_key");
if (apikeys.Contains(key.Value) && checkfunction(key.Value,function)==true) { return true; }