From 8ba3f7ccb4a96566c5efb244936f75ca60ebff3b Mon Sep 17 00:00:00 2001 From: Mole Date: Wed, 17 Feb 2021 14:21:59 +0100 Subject: [PATCH] Remove UmbracoBackOfficeIdentity --- .../Security/UmbracoBackOfficeIdentity.cs | 16 ---------------- .../Security/BackOfficeClaimsPrincipalFactory.cs | 2 +- .../TestControllerActivatorBase.cs | 3 ++- .../CheckIfUserTicketDataIsStaleAttribute.cs | 2 +- .../Security/BackOfficeSecureDataFormat.cs | 2 +- 5 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs diff --git a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs b/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs deleted file mode 100644 index 03d0699a12..0000000000 --- a/src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; - -namespace Umbraco.Core.Security -{ - - /// - /// A custom user identity for the Umbraco backoffice - /// - [Serializable] - public class UmbracoBackOfficeIdentity : ClaimsIdentity - { - } -} diff --git a/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs b/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs index f3f284fa84..906d15c220 100644 --- a/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs +++ b/src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs @@ -26,7 +26,7 @@ namespace Umbraco.Core.Security /// /// - /// Returns a custom and allows flowing claims from the external identity + /// Returns a ClaimsIdentity that has the required claims, and allows flowing of claims from external identity /// public override async Task CreateAsync(BackOfficeIdentityUser user) { diff --git a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs index 3e9add3b89..18115b9dc9 100644 --- a/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs +++ b/src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Net.Http; +using System.Security.Claims; using System.Web; using System.Web.Http; using System.Web.Http.Controllers; @@ -93,7 +94,7 @@ namespace Umbraco.Tests.TestHelpers.ControllerTesting //chuck it into the props since this is what MS does when hosted and it's needed there request.Properties["MS_HttpContext"] = httpContext; - var backofficeIdentity = (UmbracoBackOfficeIdentity) owinContext.Authentication.User.Identity; + var backofficeIdentity = (ClaimsIdentity) owinContext.Authentication.User.Identity; var backofficeSecurity = new Mock(); diff --git a/src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs b/src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs index db3da94eb1..88182464e0 100644 --- a/src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs +++ b/src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs @@ -112,7 +112,7 @@ namespace Umbraco.Web.BackOffice.Filters return; } - var identity = actionContext.HttpContext.User.Identity as UmbracoBackOfficeIdentity; + var identity = actionContext.HttpContext.User.Identity as ClaimsIdentity; if (identity == null) { return; diff --git a/src/Umbraco.Web.BackOffice/Security/BackOfficeSecureDataFormat.cs b/src/Umbraco.Web.BackOffice/Security/BackOfficeSecureDataFormat.cs index c16430097f..0e12a173f7 100644 --- a/src/Umbraco.Web.BackOffice/Security/BackOfficeSecureDataFormat.cs +++ b/src/Umbraco.Web.BackOffice/Security/BackOfficeSecureDataFormat.cs @@ -9,7 +9,7 @@ namespace Umbraco.Web.BackOffice.Security { /// - /// Custom secure format that ensures the Identity in the ticket is and not just a ClaimsIdentity + /// Custom secure format that ensures the Identity in the ticket is verified /// internal class BackOfficeSecureDataFormat : ISecureDataFormat {