File tree Expand file tree Collapse file tree 1 file changed +0
-18
lines changed
samples/ProtectedMCPServer Expand file tree Collapse file tree 1 file changed +0
-18
lines changed Original file line number Diff line number Diff line change 7676 metadata . ResourceDocumentation = new Uri ( "https://docs.example.com/api/weather" ) ;
7777} ) ;
7878
79- // // Configure authentication using the built-in authentication system
80- // builder.Services.AddAuthentication(options =>
81- // {
82- // options.DefaultScheme = "Bearer";
83- // options.DefaultChallengeScheme = "Bearer"; // Ensure challenges use Bearer scheme
84- // })
85- // .AddScheme<AuthenticationSchemeOptions, SimpleAuthHandler>("Bearer", options => { });
86-
87- //// Add authorization policy for MCP
88- //builder.Services.AddAuthorization(options =>
89- //{
90- // options.AddPolicy("McpAuth", policy =>
91- // {
92- // policy.RequireAuthenticatedUser();
93- // policy.RequireClaim("scope", "weather.read");
94- // });
95- //});
96-
9779var app = builder . Build ( ) ;
9880
9981app . UseAuthentication ( ) ;
You can’t perform that action at this time.
0 commit comments