Open imadtbro opened 1 day ago
Hi there @imadtbro!
Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.
We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.
We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.
Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:
Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)
13.4.1
Bug summary
Implementing Cookie Based Authentication (https://learn.microsoft.com/en-us/aspnet/core/security/authentication/cookie?view=aspnetcore-8.0) and using it to login causes logging into the back office break.
Specifics
After implementing Cookie Based Authentication and using it to login on the frontend, logging into the back office returns an angular error:
Cookie Based Implementation is as follows:
Create UmbracoBuilderExtensions class to set up cookie based authentication details:
Add Builder Extension to Configure Services in Startup.cs:
Add Use Authentication to app build in Startup.cs
Set up a simple login functionality into a home page controller:
The "_httpContentAccessor" is IHttpContextAccessor injected into the home page controller.
This implementation successfully logs the user in. Calling "_httpContextAccessor.HttpContext.User.Identity.IsAuthenticated" successfully returns true after executing this code.
Performing a "_httpContextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);" will successfully log the user out and makes calling "_httpContextAccessor.HttpContext.User.Identity.IsAuthenticated" return false.
While a frontend user is logged in, logging into the back office works, but the error mentioned above immediately happens and causes the back office to not load.
Logging out the frontend user returns the back office to working correctly.
Steps to reproduce
Implementing the code in the above specifics section. Logging in a user on the front end. Logging into the back office while a front end user is logged in causes the error to happen.
Expected result / actual result
The expected result is that the back office will still load properly whether a front end user is logged in or not.
The actual result is the back office not loading properly.
I'm not sure if this is a bug or has to do with how I have this implemented. We are rebuilding an Umbraco 8 site in Umbraco 13. The Umbraco 8 site made use of the cookie based authentication and worked fine.