Skip to content

fix: allow multiple algorthms to be configured for compatibility store - #143

Open
jhbritton-RSK wants to merge 4 commits into
mainfrom
bug/132-compatibility-key-store-configure-algrithms
Open

jhbritton-RSK wants to merge 4 commits into
mainfrom
bug/132-compatibility-key-store-configure-algrithms

Conversation

@jhbritton-RSK

@jhbritton-RSK jhbritton-RSK commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Added setting for supported algorithms to the compatibility key store. Previously, if more than one signing algorithm was used in existing solutions, the latest key, regardless of the algorithm, would be used. No, by default, the latest RS256 key is used, and you can configure a list of supported algorithms in priority order.

Settings also added to configure key propagation time to prevent publishing of keys that have not yet had time to propagate. If no older keys exist, though, the oldest unpublished key will still be used as the fallback.

Edit: Discovered and fixed bug causing excepsion to be thrown when loading 'ES512' keys.

Type of change

  • Bug fix
  • Feature
  • Refactoring
  • Documentation
  • Other

Does this PR introduce a breaking change?

n/a

Testing

Added tests to signing key store to check for edge cases that new configuration setting should affect.

LLM Usage

n/a

Other context

n/a

@patchandthat patchandthat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments left

Comment thread docs/topics/compatibility.rst Outdated

You will be able to configure read-only access to the ``Keys`` table in Open.IdentityServer. This will take the latest
signing key that exists and use it for signing, and all signing keys in the table will be used for validation. We have added the extension method ``IIdentityServerBuilder.AddCompatibilityKeyStores`` which will register these key stores in the DI container for you.
signing key that exists for each configured algorithm and use it for signing, and all non-expired signing keys in the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all needs rewording - it's not consistent with the behaviour given the introduction of propagation time.

@jhbritton-RSK jhbritton-RSK Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re worded

Comment thread docs/topics/compatibility.rst Outdated

If you need automatic key rotation, see our KeyRotation component on `identityserver.com products page <https://www.identityserver.com/products>`_.
.. note::
By default, the default propagation time will be respected if possible, and only RS256 keys will be loaded for signing,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ought to be broken into two sentences?

/// <summary>
/// Specifies signing algorthm of signing key to retrieve, defaults to <c>RS256</c>
/// </summary>
public string Algorithm = SecurityAlgorithms.RsaSha256;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a public field, not a property?

Also should the algorithm(s) not be pulled from the configured options?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I register a signing credential store for each supported algorithm, this works well with the way the existing KeyMaterialService works and requires no changes to this service. But this means that the algorithm filter in the store needs to be settable on init property.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatability key store should respect configured algorithms

3 participants