update 20241113
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user