Cleaning up websecurity and implementing it, migrates security stamp and session id validation for cookie auth

This commit is contained in:
Shannon
2020-06-02 13:28:30 +10:00
parent d85fc0d353
commit b75fba71f5
33 changed files with 489 additions and 756 deletions

View File

@@ -23,7 +23,11 @@ namespace Umbraco.Web.Common.Security
private readonly IHostingEnvironment _hostingEnvironment;
private readonly IHttpContextAccessor _httpContextAccessor;
public WebSecurity(IUserService userService, IGlobalSettings globalSettings, IHostingEnvironment hostingEnvironment, IHttpContextAccessor httpContextAccessor)
public WebSecurity(
IUserService userService,
IGlobalSettings globalSettings,
IHostingEnvironment hostingEnvironment,
IHttpContextAccessor httpContextAccessor)
{
_userService = userService;
_globalSettings = globalSettings;
@@ -63,11 +67,6 @@ namespace Umbraco.Web.Common.Security
return ValidateCurrentUser(throwExceptions);
}
public void ClearCurrentLogin()
{
//throw new NotImplementedException();
}
public Attempt<int> GetUserId()
{
return Attempt.Succeed(-1);
@@ -79,11 +78,6 @@ namespace Umbraco.Web.Common.Security
return httpContext?.User != null && httpContext.User.Identity.IsAuthenticated && httpContext.GetCurrentIdentity() != null;
}
public double PerformLogin(int userId)
{
return 100;
}
public bool UserHasSectionAccess(string section, IUser user)
{
return true;