diff --git a/Source/Applications/SystemCenter/Startup.cs b/Source/Applications/SystemCenter/Startup.cs index 9020b6d7b..d744b6949 100644 --- a/Source/Applications/SystemCenter/Startup.cs +++ b/Source/Applications/SystemCenter/Startup.cs @@ -31,6 +31,7 @@ using GSF.Web.Security; using Microsoft.AspNet.SignalR; using Microsoft.AspNet.SignalR.Json; +using Microsoft.Owin; using Microsoft.Owin.Cors; using Microsoft.Owin.Extensions; using Newtonsoft.Json; @@ -46,8 +47,10 @@ public void Configuration(IAppBuilder app) { app.Use(async (context, next) => { + PathString loginPath = new PathString(AuthenticationOptions.GetFullLoginPath("")); + string frameAncestor = context.Request.Path.Equals(loginPath) ? "self" : "none"; context.Request.Environment["AuthenticationOptions"] = AuthenticationOptions.Readonly; - //context.Response.Headers.Add("Content-Security-Policy", ["frame-ancestors 'none'"]); + context.Response.Headers.Add("Content-Security-Policy", [$"frame-ancestors '{frameAncestor}'"]); await next.Invoke(); context.Response.Headers.Remove("Server"); });