Skip to content

Commit

Permalink
Fix #878 - Add OIDC Metadata URL to CSP header Frame ancessor
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand committed Jun 30, 2022
1 parent 50f741c commit c00351b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/AzureIoTHub.Portal/Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,15 @@ public async void Configure(IApplicationBuilder app, IWebHostEnvironment env)
_ = app.UseProblemDetails();
app.UseIfElse(IsApiRequest, UseApiExceptionMiddleware, UseUIExceptionMiddleware);

_ = app.UseSecurityHeaders();
_ = app.UseSecurityHeaders(opts =>
{
_= opts.AddContentSecurityPolicy(csp =>
{
_ = csp.AddFrameAncestors()
.Self()
.From(app.ApplicationServices.GetService<ConfigHandler>().OIDCMetadataUrl);
});
});

if (env.IsDevelopment())
{
Expand Down

0 comments on commit c00351b

Please sign in to comment.