Fix build issues after merge
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 =>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user