Merge branch 'netcore/dev' into netcore/task/6973-migrating-authenticationcontroller

# Conflicts:
#	src/Umbraco.Core/Constants-Security.cs
#	src/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactory.cs
#	src/Umbraco.Infrastructure/BackOffice/BackOfficeUserManager.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Tests.AcceptanceTest/cypress/integration/Tour/backofficeTour.ts
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Controllers/DenyLocalLoginAuthorizationAttribute.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/Extensions/HtmlHelperBackOfficeExtensions.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.Common/Security/ExternalSignInAutoLinkOptions.cs
#	src/Umbraco.Web.UI.Client/src/common/interceptors/_module.js
#	src/Umbraco.Web.UI.Client/src/common/interceptors/requiredheaders.interceptor.js
#	src/Umbraco.Web.UI.Client/src/views/common/overlays/user/user.controller.js
#	src/Umbraco.Web.UI.NetCore/umbraco/UmbracoBackOffice/Default.cshtml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/Filters/IsCurrentUserModelFilterAttribute.cs
#	src/Umbraco.Web/Security/AppBuilderExtensions.cs
#	src/Umbraco.Web/Security/AuthenticationOptionsExtensions.cs
#	src/Umbraco.Web/UmbracoDefaultOwinStartup.cs
This commit is contained in:
Shannon
2020-10-23 10:10:02 +11:00
parent ca8e54ffc6
commit 1400a02798
126 changed files with 3498 additions and 635 deletions

View File

@@ -18,6 +18,7 @@ using Umbraco.Web.Features;
using Umbraco.Web.Models;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebAssets;
using Umbraco.Core;
namespace Umbraco.Extensions
{
@@ -63,6 +64,7 @@ namespace Umbraco.Extensions
/// <param name="signInManager"></param>
/// <returns></returns>
public static async Task<IHtmlContent> AngularValueExternalLoginInfoScriptAsync(this IHtmlHelper html,
BackOfficeExternalLoginProviderErrors externalLoginErrors,
BackOfficeSignInManager signInManager,
IEnumerable<string> externalLoginErrors)
{
@@ -89,13 +91,15 @@ namespace Umbraco.Extensions
if (externalLoginErrors != null)
{
foreach (var error in externalLoginErrors)
foreach (var error in externalLoginErrors.Errors)
{
sb.AppendFormat(@"errors.push(""{0}"");", error).AppendLine();
sb.AppendFormat(@"errors.push(""{0}"");", error.ToSingleLine()).AppendLine();
}
}
sb.AppendLine(@"app.value(""externalLoginInfo"", {");
if (externalLoginErrors?.AuthenticationType != null)
sb.AppendLine($@"errorProvider: '{externalLoginErrors.AuthenticationType}',");
sb.AppendLine(@"errors: errors,");
sb.Append(@"providers: ");
sb.AppendLine(JsonConvert.SerializeObject(loginProviders));
@@ -104,6 +108,12 @@ namespace Umbraco.Extensions
return html.Raw(sb.ToString());
}
[Obsolete("Use the other overload instead")]
public static IHtmlString AngularValueExternalLoginInfoScript(this HtmlHelper html, IEnumerable<string> externalLoginErrors)
{
return html.AngularValueExternalLoginInfoScript(new BackOfficeExternalLoginProviderErrors(string.Empty, externalLoginErrors));
}
/// <summary>
/// Used to render the script that will pass in the angular "resetPasswordCodeInfo" service/value on page load
/// </summary>