-
Notifications
You must be signed in to change notification settings - Fork 0
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
Signing key rotation does not consider actual key lifetime #1234
Comments
When IdentityServer creates keys it doesn't store them with a date-time on which they should retire. Instead when determining if a key should be rotated it calculates its age (it does know when it is created) and checks it against the current RotationInterval setting. |
@bertsch-ronja-office Did this help you out? If so I'd like to close. |
@RolandGuijt Exactly, I was referring to the discovery endpoint. We felt that the new rotation interval was used for calculating the next rotation time (the RotationInterval was increased and the keys were not rotated, hence expired). |
As I explained the key doesn't have an embedded or stored rotation time. When it's time for a key rotation check IdentityServer simply uses the current RotationInterval that is set to see if a rotation is necessary. So knowing this: is there still a problem? |
@bertsch-ronja-office All good? If so I'd like to close. |
@RolandGuijt I understand your explanation, but it does not fit what happened to us. We increased the rotation time and afterwards the Identity Server did not rotate the signing keys. And indeed we have the same assumption as you have:
Current RotationInterval from my understanding is the new (increased) one which led IdentityServer to not rotate the key. |
@bertsch-ronja-office I'm not quite following how the scenario you describe is not behaving as expected. If I got this right you started with a setup where At this point key B will be used until it is 12 hours old. There are some more details of when key creation happens, there is also a I also don't quite understand what you mean with "invalid keys at the endpoint". There is normally no lifetime/expiry time exposed in the keys at the jwks endpoint. Do you have |
@bertsch-ronja-office Did you manage to resolve this? If so I'd like to close the issue. |
Hi @RolandGuijt , we have the Before the change we had:
The change included:
Is the issue that the |
@bertsch-ronja-office Thank you for the additional details. The The I think that this is an oversight on our end. I've added DuendeSoftware/IdentityServer#1571 to discuss the issue. |
Closing this issue. Please track it using the mentioned IdentityServer issue. |
Which version of Duende IdentityServer are you using?
6.2.3
Which version of .NET are you using?
7.0
Describe the bug
When increasing the RotationInterval for signing keys as described here new signing keys are not created anymore until the new RotationInterval passed. This leads to invalid keys at the endpoint for some time (~ NewRotationInternal - OldRotationInterval)
To Reproduce
Expected behavior
After the old key expired (latest one hour after deployment of new RotationInterval), new ones should be created.
Log output/exception with stacktrace
There is no exception within the application, but it can be discovered that they keys at the endpoint will be invalid after the OldRotationInterval passed.
The text was updated successfully, but these errors were encountered: