aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/Authentication/ApiKeyAuthentication.cs2
-rw-r--r--src/slskd/Common/Authentication/AuthPolicy.cs2
-rw-r--r--src/slskd/Program.cs6
3 files changed, 8 insertions, 2 deletions
diff --git a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs
index a41a9d59..7c6c9235 100644
--- a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs
+++ b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs
@@ -34,7 +34,7 @@ namespace slskd.Authentication
/// <summary>
/// Gets the API key authentication scheme name.
/// </summary>
- public static string AuthenticationScheme { get; } = "API Key";
+ public static string AuthenticationScheme { get; } = "ApiKey";
}
/// <summary>
diff --git a/src/slskd/Common/Authentication/AuthPolicy.cs b/src/slskd/Common/Authentication/AuthPolicy.cs
index 040104da..47d430c9 100644
--- a/src/slskd/Common/Authentication/AuthPolicy.cs
+++ b/src/slskd/Common/Authentication/AuthPolicy.cs
@@ -23,7 +23,7 @@ namespace slskd
public static class AuthPolicy
{
public const string JwtOnly = "Jwt";
- public const string ApiKeyOnly = "ApiKeyOnly";
+ public const string ApiKeyOnly = "ApiKey";
public const string Any = "Any";
}
}
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index d0b670a2..28ef7279 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -696,6 +696,12 @@ namespace slskd
policy.RequireAuthenticatedUser();
});
+ options.AddPolicy(AuthPolicy.ApiKeyOnly, policy =>
+ {
+ policy.AuthenticationSchemes.Add(PassthroughAuthentication.AuthenticationScheme);
+ policy.RequireAuthenticatedUser();
+ });
+
options.AddPolicy(AuthPolicy.JwtOnly, policy =>
{
policy.AuthenticationSchemes.Add(PassthroughAuthentication.AuthenticationScheme);