Skip to content

UX-07: Swagger UI's token expires after 5 minutes; give cmapi-docs a longer access token #283

Open

Description

@ephico2real2

Part of #13

What is wrong

Swagger UI at /docs signs in through client cmapi-docs and does not renew the token. Realm cmapi issues access tokens for 5 minutes (accessTokenLifespan: 300, deploy/manifests/environments/crc/realm/10-realm-import.yaml:47; the chart's keycloak-realm.yaml:77). So 5 minutes after Authorize, every call answers:

{"type": "https://cmapi.apps-crc.testing/problems/unauthenticated", "status": 401, "detail": "Token expired", "code": "unauthenticated"}

The owner hit this on CRC on 2026-11-15: "why so many fast expiration time". The portal does not have the problem, because it renews before the 5 minutes end (docs/15, "Renewal").

What it must do

  • Keep the realm's 5 minutes for the portal and for automation: a bearer token cannot be revoked once issued.
  • Give client cmapi-docs alone a longer access token, through Keycloak's per-client attribute access.token.lifespan. Proposed: 1800 s (30 min), within its client.session.max.lifespan of 28800 (10-realm-import.yaml:284). Research the value against current guidance and record it.
  • Apply it in the plain realm import and the chart, and update docs/15's token table.
  • On the running CRC, apply it as a change to realm cmapi only. No other realm is touched.

Research mandate

  • Read the Keycloak 26 server administration guide on client-level token lifespans (Advanced settings, "Access Token Lifespan"). Confirm the attribute name for RHBK 26.6.7.
  • Read RFC 9700 (OAuth 2.0 Security BCP) on access-token lifetime, and RFC 9068.
  • Cite each with the date it was read.

How to prove it

  • The realm test: a token from cmapi-docs has exp - iat = 1800, and a token from cmapi-portal or cmapi-automation has 300. It fails on main and passes after.
  • On CRC: sign in through /docs, then call an endpoint after 6 minutes and get 200.

Activity

  1. added
    enhancement
    status:open
    Backlog
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogenhancementstatus:open

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions