-
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
Redis DataProtection start to work too late #11790
Comments
@kevinchalet @jtkech may have some insights here. |
The issue starts from the fact that your solution is using Database Shell settings instead of Blob Storage. We currently don't save the certificates in the database which would probably solve the issue. Else, if you have 2 different hosts it will save a new certificate in each of them which will cause the issue. Your 2 hosts would need at least to use the same shared App_Data folder but it is not recommended to do so because of concurrency issues. So, yeah, I think it is a missing implementation for the Redis feature and the OpenId feature (certificates). In the mean time, the workaround is to use the shared blob storage settings feature "OrchardCore_DataProtection_Azure" and "OrchardCore_Shells_Azure" instead of "OrchardCore_Shells_Database". |
Thank you, but we may not use "OrchardCore_DataProtection_Azure" and "OrchardCore_Shells_Azure". Our application should deploy only in local network. How can we store certificates in the database? |
I will take a look if @jtkech doesn't |
I believe it starts from there : OrchardCore/src/OrchardCore.Modules/OrchardCore.OpenId/Services/OpenIdServerService.cs Line 273 in e2a2734
|
I will try to look at it too when I will have time Yes, need to understand why it first still uses a |
Maybe related to #11501 (comment), I can repro locally the same kind of configuration, so I will try to investigate more when I will have time. |
Okay, I made some progress on #11501 with the same kind of config locally, and now I can debug in pod containers, so I started some first tests. For now just put some breakpoints and enabled the openId server, In the Then I saw that it persists a certificate, the data protector still using a Then, when reloading the tenant, I saw that it doesn't persist again a certificate but read a password. This is where I"m, for now all seems to be as expected ;) Will see this week end if I can find something. |
Hello @jtkech
It works without new certificate creation during 3 days, but today DataProtection key has been changed for some reason (I don't know why).
But maybe we should use single certificate store (in DB for example) in multi host configuration? |
Okay, good to know, I saw in the code that the lifetime is around 7 days.
Okay, so I don't think it is a config order concern. When you do a new deployment, I assume that the .pfx and .pwd files are still there because you are moving the .pwd files to limit the warnings. So, as I understand, the only reason that would explain the issue is that you lost the redis DP keys. Are your redis instance(s) configured for any persistency? For info, a startup has an Order property and also a ConfigureOrder that we can also override, useful when a startup has both a ConfigureServices() and Configure() and need to have different order. But if you don't override ConfigureOrder, it"s value will just come from the Order value. |
@jtkech |
Cool, good to know that it now works on your side. |
Hi, I was able to resolve the error by including the MultiCache.StackExchangeRedis nuget package. This package should not be included in the OrchardCore.Redis.Abstractions module? |
Yes, to make it working @mazuryv needed to reference an up to date package, see #11617 (comment), and we also needed to update Maybe in our last main branch we now reference the up to date package, @mazuryv can you help @micrub-it on this one, if you have time ;) |
@jtkech I also verified that, with redis and distributed cache enabled, if there is a connection problem with redis/sentinel, admin authentication fails. This line fails: This is a bit frustrating! As this way you can't disable redis and distributed cache! |
Hello. |
Hello.
We use 2 hosts to deploy our solution based on Orchard.Core.
Relation with them ensure with Redis master-slave/sentinel approach.
Modules are enabled:
When application is starting:
Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions
methodAddDataProtection(OrchardCoreBuilder builder)
and looks like protection is start to use with inMemory key.
Later configured new KeyManagementOptions
and use key from Redis key:
But when system uses not Redis dataprotection key
OpenIdServerService
start to create new certificates:Old certificates can't be read (password can't extract the certificate password from the separate .pwd file.)
And new certificates are created!!!
They are created each time when installation is started.
Later
OpenIdBackgroundTask
throws warning message about all old certificates each 30 mins!!!I propose:
What do you think about that?
The text was updated successfully, but these errors were encountered: