bug: Stale Json Web Keys. #2463

Closed
opened 2026-11-06 00:14:56 +00:00 by mee92117 · 3 comments

What is the bug?

Continuwuity remembers OIDC keys once on startup. Rotating the Json Web Keys (JWKs) can cause login failures. My continuwuity instance stopped logging in in November while it was working before.

Continuwuity does not log in after scheduled Rauthy Json Web Keys rotation, which causes users to not being able to log in. I expect it to log in, but instead it shows an error "Bad request" and "Identity server is misconfigured. Contact your homeserver's administrator.".

Steps to reproduce

To reproduce this problem install Rauthy v0.37.2, continuwuity 26.9.1 (abf8f87) and prepare two accounts.

  1. Configure Continuwuity to work with Rauthy identity provider.
  2. Log in to Continuwuity via Rauthy and expect it to succeed.
  3. Log out.
  4. Log in to Rauthy as Rauthy administrator.
  5. Go to Rauthy admin panel -> Config -> JWKS and hit Rotate Keys button.
  6. Wait for JwksRotated event.
  7. Log out.
  8. Try to log in to Continuwuity via Rauthy and expect it to fail.
  9. Send !admin server restart command to continuwuity admin room.
  10. Wait for Continuwuity to start responding.
  11. Log in to Continuwuity via Rauthy and expect it to succeed.

Server name and version

Private server running continuwuity 26.9.1 (abf8f87)

Additional context

I suspect the reason is stale JWKs. In this case the following happen.
Continuwuity does not go back to the jwks_uri location to re-retrieve the keys when it sees an unfamiliar kid value, which causes failure to verify id token claims because signature verification failed. The user sees "Bad request" and "Identity server is misconfigured. Contact your homeserver's administrator.". I expect it to follow OpenID Connect Core 1.0 10.1.1. Rotation of Asymmetric Signing Keys, retrieve new keys and succeed login attempt.

### What is the bug? Continuwuity remembers OIDC keys once on startup. Rotating the Json Web Keys (JWKs) can cause login failures. My continuwuity instance stopped logging in in November while it was working before. Continuwuity does not log in after scheduled Rauthy Json Web Keys rotation, which causes users to not being able to log in. I expect it to log in, but instead it shows an error "Bad request" and "Identity server is misconfigured. Contact your homeserver's administrator.". ### Steps to reproduce To reproduce this problem install Rauthy v0.37.2, continuwuity 26.9.1 (abf8f87) and prepare two accounts. 1. Configure Continuwuity to work with Rauthy identity provider. 2. Log in to Continuwuity via Rauthy and expect it to succeed. 3. Log out. 4. Log in to Rauthy as Rauthy administrator. 5. Go to Rauthy admin panel -> Config -> JWKS and hit Rotate Keys button. 6. Wait for JwksRotated event. 7. Log out. 8. Try to log in to Continuwuity via Rauthy and expect it to fail. 9. Send !admin server restart command to continuwuity admin room. 10. Wait for Continuwuity to start responding. 11. Log in to Continuwuity via Rauthy and expect it to succeed. ### Server name and version Private server running continuwuity 26.9.1 (abf8f87) ### Additional context I suspect the reason is stale JWKs. In this case the following happen. Continuwuity does not go back to the jwks_uri location to re-retrieve the keys when it sees an unfamiliar kid value, which causes failure to verify id token claims because signature verification failed. The user sees "Bad request" and "Identity server is misconfigured. Contact your homeserver's administrator.". I expect it to follow OpenID Connect Core 1.0 10.1.1. Rotation of Asymmetric Signing Keys, retrieve new keys and succeed login attempt.
Owner

Please provide the error that Continuwuity logs to the console when you try to log in. That will have more detail than the error presented to users.

Please provide the error that Continuwuity logs to the console when you try to log in. That will have more detail than the error presented to users.
Author
conduwuit_service::oidc: Failed to verify id token claims: Signature verification failed
at src/service/oidc/mod.rs:318 on conduwuit:worker ThreadId(4)
in tower_sessions::service::call
``` conduwuit_service::oidc: Failed to verify id token claims: Signature verification failed at src/service/oidc/mod.rs:318 on conduwuit:worker ThreadId(4) in tower_sessions::service::call ```
Owner

Fixed by !2497, which has been merged to main.

Fixed by !2497, which has been merged to main.
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2463
No description provided.