feat: Support multiple JWS signing algorithms (algorithm agility) for issued tokens
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- kotlin
- Domain
- authentication, backend-api-design, security
Research direction
Start by reading the listed key and token files: KeyUtils.kt, JwtProvider.kt, TokenVerifiers.kt, SigningKeyPublisher.kt, OIDCDiscoveryResponse.kt, and TokenRouter.kt, then inspect the client model and OAuthClientRepository.kt. Map how keys are generated, published, advertised, selected, and verified before resolving the open configuration and migration questions. Done means RS256 remains supported, configured algorithms and keys are advertised and published, and ID Tokens use each client's selected algorithm.
Written by the indexing model from the issue text.
Description
Summary
Support multiple JWS signing algorithms (algorithm agility) for issued tokens, so that MineAuth can add stronger or post-quantum algorithms (e.g. ES256, EdDSA, and later ML-DSA) without breaking existing relying parties.
Background
MineAuth currently has a single, hard-coded signing setup:
KeyUtils.generateKeyPair()generates one RSA-2048 key pair (KeyPairGenerator.getInstance("RSA"),initialize(2048, ...)).JwtProvider.algorithmis fixed toAlgorithm.RSA256(auth0java-jwt), and the same algorithm is used for both signing and verifying.SigningKeyPublisherwrites exactly one RSA key (with the configuredkid) tojwks.json.- OIDC Discovery advertises
id_token_signing_alg_values_supported = ["RS256"]only. - Clients have no
id_token_signed_response_algsetting.
RSA is not quantum-resistant, and RSA-2048 provides only ~112-bit classical security. OpenID Connect already provides the mechanisms needed for algorithm agility:
- Discovery:
id_token_signing_alg_values_supported(and the related*_alg_values_supportedfields). - Client metadata:
id_token_signed_response_alg(defaults toRS256when omitted). - JWKS: multiple keys of different types; verifiers select the key by the
kid/algJOSE header.
Note that OpenID Connect Core 1.0 §15.1 requires OPs to support RS256, so new algorithms must be added alongside RS256, not replace it.
Proposal
- Multiple signing keys: allow one signing key per algorithm (each with its own
kid), generated / loaded byKeyUtils, and publish all public keys injwks.json. - Discovery: build
id_token_signing_alg_values_supportedfrom the configured keys instead of a hard-coded list. - Per-client algorithm: add
id_token_signed_response_algto the client model (defaultRS256) and pick the signing key when issuing ID Tokens. - Internal tokens: decide whether access / refresh / service tokens keep a single server-wide algorithm or follow the same selection. Verifiers (
TokenVerifiers,KindRestrictedVerifier) must accept every configured key, selected bykid. - Post-quantum (follow-up): add ML-DSA (
ML-DSA-44/65/87, draft-ietf-cose-dilithium / JOSE) once relying-party support is realistic. auth0java-jwtdoes not support ML-DSA, so this likely requires moving signing / verification to Nimbus JOSE (already a dependency) with BouncyCastle.
Open questions
- Configuration shape for multiple keys (list of
{ alg, kid, key files }vs. auto-generation per enabled algorithm). - Migration of existing single-key installations (keep the current
kidas the RS256 key). - Whether to replace
java-jwtwith Nimbus in this change or in the ML-DSA follow-up. - Key rotation interplay (multiple keys per algorithm during rotation).
Affected Files
core/src/main/kotlin/party/morino/mineauth/core/file/utils/KeyUtils.ktcore/src/main/kotlin/party/morino/mineauth/core/file/utils/JwtProvider.ktcore/src/main/kotlin/party/morino/mineauth/core/file/utils/TokenVerifiers.ktcore/src/main/kotlin/party/morino/mineauth/core/file/utils/SigningKeyPublisher.ktcore/src/main/kotlin/party/morino/mineauth/core/web/components/auth/OIDCDiscoveryResponse.ktcore/src/main/kotlin/party/morino/mineauth/core/web/router/auth/oauth/TokenRouter.kt- Client model / repository (
OAuthClientRepository.kt)
References
- Dominant language
- Kotlin
- Stars
- 1
- Forks
- 1
- Avg merge
- 23h 35m
- Merged PRs (30d)
- 36
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from morinoparty/MineAuth
-
enhancement priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
morinoparty/MineAuth#546 ·
Maintainers usually reply within 1 day
-
chore priority: low
Difficulty 3/5 1-2 days Newbie friendliness 55/100
morinoparty/MineAuth#549 ·
Maintainers usually reply within 1 day
-
bug priority: low
Difficulty 4/5 3-5 days Newbie friendliness 48/100
morinoparty/MineAuth#548 ·
Maintainers usually reply within 1 day
-
enhancement priority: low security
Difficulty 4/5 3-5 days Newbie friendliness 56/100
morinoparty/MineAuth#547 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 4/5 3-5 days Newbie friendliness 52/100
morinoparty/MineAuth#545 ·
Maintainers usually reply within 1 day
All issues in morinoparty/MineAuth
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
hnvy/ledgedroid#20 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PixelPlayerHQ/PixelPlayerOSS#325 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
MetrolistGroup/Metrolist#5789 ·
Maintainers usually reply within 1 day