Skip to content

Commit e044475

Browse files
committed
Update McpAuthenticationHandler.cs
1 parent f3a3715 commit e044475

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ModelContextProtocol.AspNetCore/Auth/McpAuthenticationHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.AspNetCore.Authentication;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.Extensions.Logging;
34
using Microsoft.Extensions.Options;
45
using System.Text.Encodings.Web;
@@ -33,7 +34,7 @@ protected override Task<AuthenticateResult> HandleAuthenticateAsync()
3334
protected override Task HandleChallengeAsync(AuthenticationProperties properties)
3435
{
3536
// Set the response status code
36-
Response.StatusCode = 401; // Unauthorized
37+
Response.StatusCode = StatusCodes.Status401Unauthorized;
3738

3839
// Generate the full resource metadata URL based on the current request
3940
var baseUrl = $"{Request.Scheme}://{Request.Host}";

0 commit comments

Comments
 (0)