diff --git a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilder.MembersIdentity.cs b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilder.MembersIdentity.cs index 98391d7590..7ad9618ba5 100644 --- a/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilder.MembersIdentity.cs +++ b/src/Umbraco.Web.Common/DependencyInjection/UmbracoBuilder.MembersIdentity.cs @@ -58,7 +58,6 @@ namespace Umbraco.Extensions .AddRoleManager() .AddMemberManager() .AddSignInManager() - .AddSignInManager() .AddErrorDescriber() .AddUserConfirmation>(); diff --git a/src/Umbraco.Web.Common/Security/IMemberSignInManager.cs b/src/Umbraco.Web.Common/Security/IMemberSignInManager.cs index 04d591866d..6eb67eb60b 100644 --- a/src/Umbraco.Web.Common/Security/IMemberSignInManager.cs +++ b/src/Umbraco.Web.Common/Security/IMemberSignInManager.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; using Umbraco.Cms.Core.Security; @@ -11,5 +12,12 @@ namespace Umbraco.Cms.Web.Common.Security Task PasswordSignInAsync(string userName, string password, bool isPersistent, bool lockoutOnFailure); Task SignInAsync(MemberIdentityUser user, bool isPersistent, string? authenticationMethod = null); Task SignOutAsync(); + + AuthenticationProperties ConfigureExternalAuthenticationProperties(string provider, string redirectUrl, string? userId = null); + Task GetExternalLoginInfoAsync(string? expectedXsrf = null); + Task UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin); + Task ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false); + Task GetTwoFactorAuthenticationUserAsync(); + Task TwoFactorSignInAsync(string? provider, string? code, bool isPersistent, bool rememberClient); } } diff --git a/src/Umbraco.Web.Common/Security/IMemberSignInManagerExternalLogins.cs b/src/Umbraco.Web.Common/Security/IMemberSignInManagerExternalLogins.cs deleted file mode 100644 index 558fd8d86b..0000000000 --- a/src/Umbraco.Web.Common/Security/IMemberSignInManagerExternalLogins.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Identity; -using Umbraco.Cms.Core.Security; - -namespace Umbraco.Cms.Web.Common.Security -{ - [Obsolete("This interface will be merged with IMemberSignInManager in Umbraco 10")] - public interface IMemberSignInManagerExternalLogins : IMemberSignInManager - { - AuthenticationProperties ConfigureExternalAuthenticationProperties(string provider, string redirectUrl, string? userId = null); - Task GetExternalLoginInfoAsync(string? expectedXsrf = null); - Task UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin); - Task ExternalLoginSignInAsync(ExternalLoginInfo loginInfo, bool isPersistent, bool bypassTwoFactor = false); - Task GetTwoFactorAuthenticationUserAsync(); - Task TwoFactorSignInAsync(string? provider, string? code, bool isPersistent, bool rememberClient); - } -} diff --git a/src/Umbraco.Web.Common/Security/MemberSignInManager.cs b/src/Umbraco.Web.Common/Security/MemberSignInManager.cs index 2710dc38c1..e0f5f19457 100644 --- a/src/Umbraco.Web.Common/Security/MemberSignInManager.cs +++ b/src/Umbraco.Web.Common/Security/MemberSignInManager.cs @@ -22,7 +22,7 @@ namespace Umbraco.Cms.Web.Common.Security /// /// The sign in manager for members /// - public class MemberSignInManager : UmbracoSignInManager, IMemberSignInManagerExternalLogins + public class MemberSignInManager : UmbracoSignInManager, IMemberSignInManager { private readonly IMemberExternalLoginProviders _memberExternalLoginProviders; private readonly IEventAggregator _eventAggregator; diff --git a/src/Umbraco.Web.Website/Controllers/UmbExternalLoginController.cs b/src/Umbraco.Web.Website/Controllers/UmbExternalLoginController.cs index 526e647b10..dc079cd605 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbExternalLoginController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbExternalLoginController.cs @@ -33,7 +33,7 @@ namespace Umbraco.Cms.Web.Website.Controllers private readonly ITwoFactorLoginService _twoFactorLoginService; private readonly IOptions _securitySettings; private readonly ILogger _logger; - private readonly IMemberSignInManagerExternalLogins _memberSignInManager; + private readonly IMemberSignInManager _memberSignInManager; public UmbExternalLoginController( ILogger logger, @@ -43,7 +43,7 @@ namespace Umbraco.Cms.Web.Website.Controllers AppCaches appCaches, IProfilingLogger profilingLogger, IPublishedUrlProvider publishedUrlProvider, - IMemberSignInManagerExternalLogins memberSignInManager, + IMemberSignInManager memberSignInManager, IMemberManager memberManager, ITwoFactorLoginService twoFactorLoginService, IOptions securitySettings) diff --git a/src/Umbraco.Web.Website/Controllers/UmbTwoFactorLoginController.cs b/src/Umbraco.Web.Website/Controllers/UmbTwoFactorLoginController.cs index c8c8536d62..e1762c40a2 100644 --- a/src/Umbraco.Web.Website/Controllers/UmbTwoFactorLoginController.cs +++ b/src/Umbraco.Web.Website/Controllers/UmbTwoFactorLoginController.cs @@ -29,7 +29,7 @@ namespace Umbraco.Cms.Web.Website.Controllers private readonly IMemberManager _memberManager; private readonly ITwoFactorLoginService _twoFactorLoginService; private readonly ILogger _logger; - private readonly IMemberSignInManagerExternalLogins _memberSignInManager; + private readonly IMemberSignInManager _memberSignInManager; public UmbTwoFactorLoginController( ILogger logger, @@ -39,7 +39,7 @@ namespace Umbraco.Cms.Web.Website.Controllers AppCaches appCaches, IProfilingLogger profilingLogger, IPublishedUrlProvider publishedUrlProvider, - IMemberSignInManagerExternalLogins memberSignInManager, + IMemberSignInManager memberSignInManager, IMemberManager memberManager, ITwoFactorLoginService twoFactorLoginService) : base(