Loading src/api/Program.cs +16 −11 Original line number Diff line number Diff line Loading @@ -31,17 +31,20 @@ ConfigureAzureKeyVault(builder); // ValidateIssuer = true // }; // options.Events = new JwtBearerEvents // { // OnTokenValidated = context => // { // ClaimsIdentity identity = (ClaimsIdentity)context.Principal!.Identity!; // var token = context.SecurityToken.RawData; // identity.AddClaim(new Claim("access_token", token)); // return Task.CompletedTask; // } // } // }); // Configure CORS policy builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { if (allowedOrigins?.Length > 0) { policy.WithOrigins(allowedOrigins) .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); } }); }); builder.Services.AddControllers(); Loading Loading @@ -85,6 +88,8 @@ app.UseStaticFiles(); // AFTER UseStaticFiles, UseExceptionHandler or UseStatusCodePagesWithReExecute but BEFORE UseAuthentication and UseAuthorization app.UseRouting(); app.UseCors(); app.UseAuthentication(); app.UseHttpsRedirection(); Loading Loading
src/api/Program.cs +16 −11 Original line number Diff line number Diff line Loading @@ -31,17 +31,20 @@ ConfigureAzureKeyVault(builder); // ValidateIssuer = true // }; // options.Events = new JwtBearerEvents // { // OnTokenValidated = context => // { // ClaimsIdentity identity = (ClaimsIdentity)context.Principal!.Identity!; // var token = context.SecurityToken.RawData; // identity.AddClaim(new Claim("access_token", token)); // return Task.CompletedTask; // } // } // }); // Configure CORS policy builder.Services.AddCors(options => { options.AddDefaultPolicy(policy => { if (allowedOrigins?.Length > 0) { policy.WithOrigins(allowedOrigins) .AllowAnyHeader() .AllowAnyMethod() .AllowCredentials(); } }); }); builder.Services.AddControllers(); Loading Loading @@ -85,6 +88,8 @@ app.UseStaticFiles(); // AFTER UseStaticFiles, UseExceptionHandler or UseStatusCodePagesWithReExecute but BEFORE UseAuthentication and UseAuthorization app.UseRouting(); app.UseCors(); app.UseAuthentication(); app.UseHttpsRedirection(); Loading