Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Replay-protection retention and configuration handling have unresolved correctness issues.
Review effort: Balanced
Findings: 1
Open (4)
What changed in this PR
Adds configurable idle expiration to Keycloak’s OID4VCI refresh tokens, addressing #52380.
Changes:
- Adds a 30-day default idle timeout, renewed on refresh and bounded by credential lifetime.
- Adds configuration validation and Admin Console controls.
- Extends backend tests, Playwright tests, and documentation.
| File | Description |
|---|---|
| tests/base/src/test/java/org/keycloak/tests/oid4vc/OID4VCRefreshCredentialTest.java | Tests idle expiration and renewal. |
| tests/base/src/test/java/org/keycloak/tests/oid4vc/OID4VCClientScopeTest.java | Tests timeout constraints. |
| services/src/main/java/org/keycloak/protocol/oid4vc/refresh/OID4VCIRefreshTokenProvider.java | Applies idle timeout to token expiration. |
| services/src/main/java/org/keycloak/protocol/oid4vc/OID4VCLoginProtocolFactory.java | Validates expiration settings. |
| services/src/main/java/org/keycloak/protocol/oid4vc/model/CredentialScopeRepresentation.java | Exposes idle-timeout accessors. |
| server-spi-private/src/main/java/org/keycloak/models/oid4vci/CredentialScopeModel.java | Defines the attribute and derived default. |
| js/apps/admin-ui/test/client-scope/oid4vci-client-scope.spec.ts | Tests timeout controls and validation. |
| js/apps/admin-ui/src/components/time-selector/TimeSelectorControl.tsx | Displays field-level validation errors. |
| js/apps/admin-ui/src/client-scopes/details/ScopeForm.tsx | Adds timeout input and dependent validation. |
| js/apps/admin-ui/maven-resources/theme/keycloak.v2/admin/messages/messages_en.properties | Adds labels, help, and validation messages. |
| docs/documentation/server_admin/topics/oid4vci/vc-issuer-configuration.adoc | Documents idle expiration and refresh behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Post-validation defaults can persist invalid scope settings, cleared-field validation remains inconsistent, and the CRL test lacks required server setup.
Review effort: Balanced
Findings: 1
Open (2)
Resolved since last review (1)
There was a problem hiding this comment.
AI review by Claude Code: Fix first · 1 should fix, 1 follow-up
The PR caps each OID4VCI refresh token at the smaller of the credential expiry and a configurable idle timeout, which restarts on every refresh. It validates the chain of refresh interval, idle timeout and credential lifetime against the merged state on update, and it keeps the rotation record until the latest expiry in the token family. The code matches the description and the earlier review points are fixed. One gap should be closed here: the derived default and the validation allow an idle timeout equal to the refresh interval, and then the refresh token expires just before the credential it should renew.
For EUDI:
EUDI issuers get a bounded refresh token by default, so a wallet that is lost or stops refreshing loses refresh rights after 30 days instead of after the full credential lifetime. Issuers with a refresh interval of 30 days or more should set an explicit idle timeout above the interval until the default leaves slack.
Claude Code wrote this review of 001b758. It read the code without building or running it.
Awambeng asked the tracker's bot account to post this.
Automatic review by Claude Opus 5.5, checked by Claude Fable 5.2: https://oid4vc-sig.eudi-test.dev/reviews/53588.html
- Add a new client-scope attribute with a 30-day default - Limit the refresh token lifetime to the configured idle timeout - Restart the idle timeout when the token is refreshed - Validate that the idle timeout is between the refresh interval and credential lifetime - Add the new field and validation to the Admin Console - Add backend, Playwright tests and update issuer documentation Closes keycloak#52380 Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
Signed-off-by: Awambeng Rodrick <awambengrodrick@gmail.com>
| * the protocol defaults, and it must be validated against the merged settings, so raising the refresh interval | ||
| * above the stored idle timeout is rejected just like a full update. | ||
| */ | ||
| @Test |



This PR adds a configurable idle timeout for OID4VCI refresh tokens. This ensures that an unused refresh token expires after a defined period instead of remaining valid for the full credential lifetime.
Key changes:
vc.refresh_idle_timeout_in_secondsclient-scope attribute with a 30-day defaultCloses #52380