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 28, 2022
1 parent 25e6b30 commit 5337635
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 5337635

Please sign in to comment.