Adding the X-Frame-Options header

This header allows the browser to protect your site from being rendered inside a frame. By using the following middleware, we can prevent our site from framing so that we can defend it against different attacks, where the most famous one is clickjacking:

app.UseXfo(options => options.SameOrigin());