File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11using MCPify . Hosting ;
22using Microsoft . AspNetCore . Authentication . JwtBearer ;
3- using Microsoft . IdentityModel . JsonWebTokens ;
3+ using ModelContextProtocol . AspNetCore . Authentication ;
44
55var builder = WebApplication . CreateBuilder ( args ) ;
66
77await builder . Services . AddMCPService ( builder . Configuration [ "ApiBaseUrl" ] ! , "v1" , builder . Configuration [ "McpServerBaseUrl" ] ! ) ;
88
9- builder . Services . AddAuthorization ( options =>
10- options . DefaultPolicy = new Microsoft . AspNetCore . Authorization . AuthorizationPolicyBuilder ( )
11- . RequireAuthenticatedUser ( )
12- . AddAuthenticationSchemes ( JwtBearerDefaults . AuthenticationScheme )
13- . Build ( ) ) ;
9+ builder . Services . AddAuthentication ( options =>
10+ {
11+ options . DefaultChallengeScheme = McpAuthenticationDefaults . AuthenticationScheme ;
12+ options . DefaultAuthenticateScheme = JwtBearerDefaults . AuthenticationScheme ;
13+ } ) ;
14+
15+ builder . Services . AddAuthorization ( ) ;
1416
1517var app = builder . Build ( ) ;
1618
You can’t perform that action at this time.
0 commit comments