We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f3c203 commit a2121dcCopy full SHA for a2121dc
src/AspNetCore.SecurityKey/SecurityKeyAuthenticationHandler.cs
@@ -52,8 +52,12 @@ public SecurityKeyAuthenticationHandler(
52
protected override async Task<AuthenticateResult> HandleAuthenticateAsync()
53
{
54
var securityKey = _securityKeyExtractor.GetKey(Context);
55
- var identity = await _securityKeyValidator.Authenticate(securityKey);
56
+ // If no security key is provided, return no result
57
+ if (string.IsNullOrEmpty(securityKey))
58
+ return AuthenticateResult.NoResult();
59
+
60
+ var identity = await _securityKeyValidator.Authenticate(securityKey);
61
if (!identity.IsAuthenticated)
62
return AuthenticateResult.Fail("Invalid Security Key");
63
0 commit comments