diff --git a/src/Umbraco.Web.Common/Extensions/HttpContextExtensions.cs b/src/Umbraco.Web.Common/Extensions/HttpContextExtensions.cs index 226755039e..2a6bbc99d4 100644 --- a/src/Umbraco.Web.Common/Extensions/HttpContextExtensions.cs +++ b/src/Umbraco.Web.Common/Extensions/HttpContextExtensions.cs @@ -59,6 +59,14 @@ public static class HttpContextExtensions await httpContext.AuthenticateAsync(Constants.Security.BackOfficeExternalAuthenticationType); } + // Update the HttpContext's user with the authenticated user's principal to ensure + // that subsequent requests within the same context will recognize the user + // as authenticated. + if (result.Succeeded) + { + httpContext.User = result.Principal; + } + return result; }