mirror of
https://github.com/jwadow/kiro-gateway.git
synced 2026-04-25 01:15:57 +03:00
[PR #29] [CLOSED] fix(auth): sync tokens with kiro-cli in SQLite mode #61
Labels
No labels
bug
bug
enhancement
enhancement
fixed
fixed
invalid
needs-info
needs-testing
pull-request
question
upstream
wontfix
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/kiro-gateway-jwadow#61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jwadow/kiro-gateway/pull/29
Author: @bhaskoro-muthohar
Created: 1/10/2026
Status: ❌ Closed
Base:
main← Head:fix/sqlite-token-sync📝 Commits (1)
566a18bfix(auth): sync tokens with kiro-cli in SQLite mode📊 Changes
1 file changed (+22 additions, -1 deletions)
View changed files
📝
kiro/auth.py(+22 -1)📄 Description
Problem
When using SQLite mode (
KIRO_CLI_DB_FILE), the gateway fails with400 Bad Requestwhen trying to refresh tokens via AWS SSO OIDC, even though kiro-cli works fine.Root cause: kiro-cli doesn't persist refreshed tokens back to SQLite - it only writes during initial login. When kiro-cli refreshes tokens in-memory, the refresh token in SQLite becomes stale/invalid. The gateway then tries to use this stale refresh token and AWS rejects it.
Related: #14
Solution
Re-read SQLite on each request - picks up fresh tokens immediately after
kiro-cli loginwithout requiring gateway restartDon't attempt token refresh in SQLite mode - since kiro-cli owns the refresh token and doesn't persist it, the gateway cannot refresh. Instead:
kiro-cli loginBehavior
kiro-cli loginkiro-cli loginTesting
Tested with kiro-cli SQLite credentials over multiple token expiration cycles.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.