Skip to content

feat(stage): auth host -> auth.stage.berget.ai (issuer migration) - #38

Merged
bergetjakob merged 2 commits into
mainfrom
feat/auth-stage-host
Sep 11, 2026
Merged

bergetjakob merged 2 commits into
mainfrom
feat/auth-stage-host

Conversation

@bergetjakob

Copy link
Copy Markdown
Contributor

Summary

Stage-flip av pluginens auth-host: getKeycloakUrl()https://auth.stage.berget.ai (authorize + PKCE token-exchange).

Varför nödvändig: med Keycloak 26.6:s dynamiska hostname gäller "mint-host == refresh-host" per token. api (stage-overlay) flippar till auth.stage i samma veva — om pluginen fortfarande exemplar via keycloak.stage mintas tokens med fel iss och varje refresh 401:ar i loop. Befintliga sessioner 401:ar en gång → /connect → ny session med auth-iss → allt fungerar.

Prod-flip (keycloak.berget.aiauth.berget.ai) levereras separat med användarkommunikation (en /connect per användare vid uppdateringen).

Test plan

  • Bygg + publicera 1.0.27
  • Med BERGET_API_URL=api.stage: /connect → login på auth.stage → tokens mintas med auth-iss
  • Refresh (>15 min eller tvungen) fungerar via api → auth-stage-host utan 401
  • Gamla sessioner: engångs-401 → /connect återställer

Stage flip of the plugin's authorize + token-exchange host. Must ship
together with the api stage-overlay flip (KEYCLOAK_URL=auth.stage): dynamic
hostname pairs mint-host with refresh-host, so client and api must agree —
otherwise refreshes 401 in a loop.

Prod flip (keycloak.berget.ai -> auth.berget.ai) ships separately with
user communication (one /connect per user on update).
Same follow-up to incident 2026-09-10-0 as the stage flip in the
preceding commit: the Keycloak cutover moved token issuance to
auth.berget.ai, so PKCE login must discover the new issuer (openid-client
strict-iss validation) . Token refresh already goes through
api /v1/auth/refresh which has issuer-routing (api #453).
@bergetjakob

Copy link
Copy Markdown
Contributor Author

Lagt till prod-flippet (getKeycloakUrl → https://auth.berget.ai) i b2abcb6 — samma uppföljning av issuer-migreringen (incident 2026-09-10-0) som stage-scenariot, jämför berget-ai/cli#89. Token refresh går via api /v1/auth/refresh som redan har issuer-routing, så endast PKCE-discovery påverkades.

@bergetjakob
bergetjakob merged commit 56ce14a into main Sep 11, 2026
1 check passed
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.

1 participant