-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug of Users Authentication Ticket Store
Feature
#13726
Comments
I Debug the code and see that the following method is called after OrchardCore.Users.Authentication.CacheTicketStore.RetrieveAsync OrchardCore/src/OrchardCore/OrchardCore.Abstractions/Shell/Scope/ShellScope.cs Lines 224 to 261 in edccca0
OrchardCore/src/OrchardCore/OrchardCore.Users.Core/Authentication/CacheTicketStore.cs Lines 57 to 77 in edccca0
|
Into your plate @ns8482e :) |
Correct it's expected behavior. IMemoryCache is destroyed and recreated when tenant is reloaded. To keep authentication ticket between tenant reload you should also enable and configure redis cache feature. |
So, should we save the Token to the database without Redis enabled? At the moment, it seems that this problem will only arise on the site Settings changed |
Yes you should not rely on IMemoryCache in production if your frequently update the features. In production You should use redid cache |
We could also have an implementation that is based on SQL. @hyzx86 you can file an issue, and maybe provide a PR for this? For this current issue maybe we should display a notification/warning when no other specific ticket store is enabled. |
@sebastienros This is not a very urgent issue in my scenario right now; After all, it's reasonable to tell users that a configuration change caused them to log back in 😁 I actually feel like this part of the code is a little hard for me to change |
Well, if we start with that, it's really not difficult. I can try it |
To achieve this, should I re-implement a SqlDistributedCache? It's like https://learn.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-6.0 This seems a bit complicated, but for distributed caching, shouldn't we make it a higher priority, such as enabling it only from the default site, and then separate the distributed caching object from the specific tenant? Just like |
Correct, you could create a feature that would register SqlDistributedCache as the |
#16149 covers SQL Distributed Cache, so we don't need to do anything specific for this module, and rather work on that. |
oc version :preview-latest
Describe the bug
After enabling the
Users Authentication Ticket Store
feature,whenever any other feature is enabled. The user is always redirected to the login page.
The text was updated successfully, but these errors were encountered: