Rotate the token signing and encryption keys without signing everyone out

Open
#3,313 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
39/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp

Research direction

Start with src/FluentCMS.Core/Identity/Oidc/SigningKeyStore.cs and the ServerCredentials code around lines 124–144, then trace token lifetimes, encryption keys, and the discovery document. The issue calls for an ADR before implementation; first establish the rotation and overlap design with maintainers. Done means accepted design and tests covering validation through the overlap, retirement, secondary certificate validation, and both discovery keys during rotation.

Written by the indexing model from the issue text.

Description

area:identity security type:feature

Problem

src/FluentCMS.Core/Identity/Oidc/SigningKeyStore.cs:21-22,32-47 only ever inserts one key per use under a fixed id; nothing adds a second. ServerCredentials (:124-144) takes one certificate with no slot for the previous one, so replacing a certificate invalidates every issued token at once. The encryption key never rotates either. An operator who suspects a key has no way to replace it without signing everyone out, and no routine rotation exists.

Proposal

Write an ADR first, then:

  • A command and a recurring job that add a new signing key and retire the old one after the longest token lifetime.
  • A secondary certificate setting, used for validation only.
  • The same for the encryption key.

Acceptance

  • ADR accepted
  • A token issued before a rotation validates until it expires
  • A retired key is removed after the overlap
  • Replacing the configured certificate with the previous one set as secondary signs nobody out
  • The discovery document lists both keys during the overlap

Found in the code review of 17 Nov 2026.

Dominant language
C#
Stars
569
Forks
107
Avg merge
2h 49m
Merged PRs (30d)
397

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from fluentcms/FluentCMS

All issues in fluentcms/FluentCMS

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.