Fix build issues after merge

This commit is contained in:
Shannon
2020-12-02 13:19:08 +11:00
parent 0f0c50b56e
commit 4f7c87d1d2
4 changed files with 7 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ namespace Umbraco.Tests.Integration.TestServerTest
{
var principal = await _backOfficeSignInManager.CreateUserPrincipalAsync(_fakeUser);
var ticket = new AuthenticationTicket(principal, TestAuthenticationScheme);
var ticket = new AuthenticationTicket(principal, Constants.Security.BackOfficeAuthenticationType);
return AuthenticateResult.Success(ticket);
}

View File

@@ -48,8 +48,8 @@ namespace Umbraco.Tests.Integration.TestServerTest
builder.ConfigureTestServices(services =>
{
// Add a test auth scheme with a test auth handler to authn and assign the user
services.AddAuthentication(TestAuthHandler.TestAuthenticationScheme)
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(TestAuthHandler.TestAuthenticationScheme, options => { });
services.AddAuthentication(Constants.Security.BackOfficeAuthenticationType)
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(Constants.Security.BackOfficeAuthenticationType, options => { });
});
});
@@ -144,7 +144,7 @@ namespace Umbraco.Tests.Integration.TestServerTest
.AddRuntimeMinifier()
.AddBackOffice()
.AddBackOfficeIdentity()
.AddBackOfficeAuthorizationPolicies(TestAuthHandler.TestAuthenticationScheme)
.AddBackOfficeAuthorizationPolicies()
.AddPreviewSupport()
//.WithMiniProfiler() // we don't want this running in tests
.AddMvcAndRazor(mvcBuilding: mvcBuilder =>

View File

@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Authorization;
using System.Threading.Tasks;
using Umbraco.Web.BackOffice.Security;
using Umbraco.Web.Common.Security;
namespace Umbraco.Web.BackOffice.Authorization

View File

@@ -62,9 +62,9 @@ namespace Umbraco.Extensions
return builder;
}
public static IUmbracoBuilder AddBackOfficeAuthorizationPolicies(this IUmbracoBuilder builder, string backOfficeAuthenticationScheme = Umbraco.Core.Constants.Security.BackOfficeAuthenticationType)
public static IUmbracoBuilder AddBackOfficeAuthorizationPolicies(this IUmbracoBuilder builder)
{
builder.Services.AddBackOfficeAuthorizationPolicies(backOfficeAuthenticationScheme);
builder.Services.AddBackOfficeAuthorizationPolicies(Umbraco.Core.Constants.Security.BackOfficeAuthenticationType);
// TODO: See other TODOs in things like UmbracoApiControllerBase ... AFAIK all of this is only used for the back office
// so IMO these controllers and the features auth policies should just be moved to the back office project and then this
// ext method can be removed.