diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj
index 008fbc47d7..44e81d604a 100644
--- a/src/Umbraco.Tests/Umbraco.Tests.csproj
+++ b/src/Umbraco.Tests/Umbraco.Tests.csproj
@@ -195,7 +195,6 @@
-
diff --git a/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs b/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs
deleted file mode 100644
index fd30f1b5ec..0000000000
--- a/src/Umbraco.Tests/Web/AngularIntegration/AngularAntiForgeryTests.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System.IO;
-using System.Net;
-using System.Security.Principal;
-using System.Web;
-using NUnit.Framework;
-using Umbraco.Web.WebApi.Filters;
-
-namespace Umbraco.Tests.Web.AngularIntegration
-{
- [TestFixture]
- public class AngularAntiForgeryTests
- {
-
- [TearDown]
- public void TearDown()
- {
- HttpContext.Current = null;
- }
-
- [Test]
- public void Can_Validate_Generated_Tokens()
- {
- using (var writer = new StringWriter())
- {
- HttpContext.Current = new HttpContext(new HttpRequest("test.html", "http://test/", ""), new HttpResponse(writer));
-
- string cookieToken, headerToken;
- AngularAntiForgeryHelper.GetTokens(out cookieToken, out headerToken);
-
- Assert.IsTrue(AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
- }
-
- }
-
- [Test]
- public void Can_Validate_Generated_Tokens_With_User()
- {
- using (var writer = new StringWriter())
- {
- HttpContext.Current = new HttpContext(new HttpRequest("test.html", "http://test/", ""), new HttpResponse(writer))
- {
- User = new GenericPrincipal(new HttpListenerBasicIdentity("test", "test"), new string[] {})
- };
-
- string cookieToken, headerToken;
- AngularAntiForgeryHelper.GetTokens(out cookieToken, out headerToken);
-
- Assert.IsTrue(AngularAntiForgeryHelper.ValidateTokens(cookieToken, headerToken));
- }
-
- }
-
- }
-}
diff --git a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs
index a807c663d0..9c415fe180 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/UmbracoAuthorizedApiController.cs
@@ -1,4 +1,4 @@
-using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.Common.Attributes;
@@ -16,7 +16,7 @@ namespace Umbraco.Web.BackOffice.Controllers
/// is logged in using forms authentication which indicates the seconds remaining
/// before their timeout expires.
///
- [IsBackOffice]
+ [IsBackOffice]
[UmbracoUserTimeoutFilter]
[Authorize(Policy = AuthorizationPolicies.BackOfficeAccess)]
[DisableBrowserCache]
diff --git a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs
index f7fd174e03..ef8e22c9d8 100644
--- a/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs
+++ b/src/Umbraco.Web.BackOffice/Filters/ValidateAngularAntiForgeryTokenAttribute.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using System.Net;
using System.Security.Claims;
using System.Threading.Tasks;
@@ -23,7 +23,8 @@ namespace Umbraco.Web.BackOffice.Filters
///
public sealed class ValidateAngularAntiForgeryTokenAttribute : TypeFilterAttribute
{
- public ValidateAngularAntiForgeryTokenAttribute() : base(typeof(ValidateAngularAntiForgeryTokenFilter))
+ public ValidateAngularAntiForgeryTokenAttribute()
+ : base(typeof(ValidateAngularAntiForgeryTokenFilter))
{
}
@@ -44,12 +45,13 @@ namespace Umbraco.Web.BackOffice.Filters
{
if (context.Controller is ControllerBase controller && controller.User.Identity is ClaimsIdentity userIdentity)
{
- //if there is not CookiePath claim, then exit
+ // if there is not CookiePath claim, then exit
if (userIdentity.HasClaim(x => x.Type == ClaimTypes.CookiePath) == false)
{
await next();
}
}
+
var cookieToken = _cookieManager.GetCookieValue(Constants.Web.CsrfValidationCookieName);
var httpContext = context.HttpContext;
diff --git a/src/Umbraco.Web/AppBuilderExtensions.cs b/src/Umbraco.Web/AppBuilderExtensions.cs
deleted file mode 100644
index f4766bc414..0000000000
--- a/src/Umbraco.Web/AppBuilderExtensions.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Web;
-using Microsoft.AspNet.SignalR;
-using Microsoft.Owin.Logging;
-using Owin;
-using Umbraco.Core.Configuration;
-using Umbraco.Core.Configuration.Models;
-using Umbraco.Core.Hosting;
-using Umbraco.Web.Logging;
-
-namespace Umbraco.Web
-{
- ///
- /// Provides general extension methods to IAppBuilder.
- ///
- public static class AppBuilderExtensions
- {
- ///
- /// Called at the end of configuring middleware
- ///
- /// The app builder.
- ///
- /// This could be used for something else in the future - maybe to inform Umbraco that middleware is done/ready, but for
- /// now this is used to raise the custom event
- ///
- /// This is an extension method in case developer entirely replace the UmbracoDefaultOwinStartup class, in which case they will
- /// need to ensure they call this extension method in their startup class.
- ///
- public static void FinalizeMiddlewareConfiguration(this IAppBuilder app)
- {
- UmbracoDefaultOwinStartup.OnMiddlewareConfigured(new OwinMiddlewareConfiguredEventArgs(app));
- }
-
- ///
- /// Sets the OWIN logger to use Umbraco's logging system.
- ///
- /// The app builder.
- public static void SetUmbracoLoggerFactory(this IAppBuilder app)
- {
- app.SetLoggerFactory(new OwinLoggerFactory());
- }
-
- ///
- /// Configures SignalR.
- ///
- /// The app builder.
- ///
- ///
- public static IAppBuilder UseSignalR(this IAppBuilder app, GlobalSettings globalSettings, IHostingEnvironment hostingEnvironment)
- {
- var umbracoPath = globalSettings.GetUmbracoMvcArea(hostingEnvironment);
- var signalrPath = HttpRuntime.AppDomainAppVirtualPath + umbracoPath + "/BackOffice/signalr";
- return app.MapSignalR(signalrPath, new HubConfiguration { EnableDetailedErrors = true });
- }
- }
-}
diff --git a/src/Umbraco.Web/Logging/OwinLogger.cs b/src/Umbraco.Web/Logging/OwinLogger.cs
deleted file mode 100644
index 7983ee36c7..0000000000
--- a/src/Umbraco.Web/Logging/OwinLogger.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using System.Diagnostics;
-using Microsoft.Extensions.Logging;
-
-namespace Umbraco.Web.Logging
-{
- internal class OwinLogger : Microsoft.Owin.Logging.ILogger
- {
- private readonly ILogger _logger;
- private readonly Lazy _type;
-
- public OwinLogger(ILogger logger, Lazy type)
- {
- _logger = logger;
- _type = type;
- }
-
- ///
- /// Aggregates most logging patterns to a single method. This must be compatible with the Func representation in the OWIN environment.
- /// To check IsEnabled call WriteCore with only TraceEventType and check the return value, no event will be written.
- ///
- ///
- ///
- public bool WriteCore(TraceEventType eventType, int eventId, object state, Exception exception, Func