Skip to content

Commit 48bff9c

Browse files
committed
Introduce proper constants
1 parent 31f8ce9 commit 48bff9c

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace ModelContextProtocol.AspNetCore.Auth;
2+
3+
/// <summary>
4+
/// Default values used by MCP authentication.
5+
/// </summary>
6+
public static class McpAuthenticationDefaults
7+
{
8+
/// <summary>
9+
/// The default value used for authentication scheme name.
10+
/// </summary>
11+
public const string AuthenticationScheme = "McpAuth";
12+
13+
/// <summary>
14+
/// The default value used for authentication scheme display name.
15+
/// </summary>
16+
public const string DisplayName = "MCP Authentication";
17+
}

src/ModelContextProtocol.AspNetCore/Auth/McpAuthorizationExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ public static AuthenticationBuilder AddMcp(
1919
this AuthenticationBuilder builder,
2020
Action<McpAuthenticationOptions>? configureOptions = null)
2121
{
22-
return AddMcp(builder, "McpAuth", "MCP Authentication", configureOptions);
22+
return AddMcp(
23+
builder,
24+
McpAuthenticationDefaults.AuthenticationScheme,
25+
McpAuthenticationDefaults.DisplayName,
26+
configureOptions);
2327
}
2428

2529
/// <summary>

0 commit comments

Comments
 (0)