docs/guides/KIRO_SETUP.md
This guide covers adding Kiro (AWS-hosted AI coding assistant) accounts to OmniRoute, with a focus on running multiple accounts simultaneously without session conflicts.
Kiro's backend uses AWS SSO OIDC client registrations to track active sessions. The critical constraint: each OIDC client registration supports only one active session at a time. When a second device or user authenticates using the same registered client, the backend invalidates the first account's refresh token.
This is the same mechanism that causes problems when running kiro-cli login on a
machine where another Kiro account is already signed in — the new login revokes the
first account's token.
Starting with v3.8.0, OmniRoute calls registerClient() (AWS SSO OIDC) during every
Kiro connection import. This gives each OmniRoute connection its own dedicated OIDC
client registration. Because each client registration is independent, refreshing or
re-authenticating one account does not affect any other account's refresh token.
The isolation applies to the refresh-token import methods, and API-key auth avoids OIDC refresh sessions entirely:
| Import method | Isolation status |
|---|---|
| AWS Builder ID / IDC device-code flow | Isolated since the device-code flow was introduced |
| Import Token (manual refresh token paste) | Isolated from v3.8.0 |
| Google / GitHub social login | Isolated from v3.8.0 |
| Auto-Import (kiro-cli SQLite) | Isolated from v3.8.0 (SQLite path was already isolated; SSO-cache fallback is now also isolated) |
| API Key (long-lived CodeWhisperer key) | No refresh session; the key is validated and stored as a bearer credential |
Connections imported before v3.8.0 do not have a dedicated OIDC client registration
stored in providerSpecificData. These connections continue to work but use the shared
social-auth refresh endpoint, which means two such connections can still invalidate each
other.
To gain isolation: delete the old connection from Dashboard → Providers and re-import it using any of the supported import flows. All newly created connections will receive their own client registration automatically.
aorAAAAAG.~/.aws/sso/cache.Repeat step 1 for the second account. Because each import creates a separate OIDC client registration, the two connections are fully isolated.
Create a combo with both connections as targets to load-balance or fall back between them:
kiro/kiro-dev → kiro/kiro-pro
See FEATURES.md and the routing documentation for combo configuration.
For AWS IAM Identity Center (IDC) accounts, use the AWS Builder ID / IDC device-code flow from Dashboard → Providers → Kiro → Device Code. The device-code flow has always been fully isolated. No re-import is needed for these connections.
Enterprise users who operate in a non-default AWS region can specify the region when importing via the Import Token API:
curl -X POST http://localhost:20128/api/oauth/kiro/import \
-H "Content-Type: application/json" \
-d '{"refreshToken": "aorAAAAAG...", "region": "eu-west-1"}'
The region field defaults to us-east-1 when omitted.
API-key auth is for long-lived Kiro / AWS CodeWhisperer bearer credentials. It does not use OAuth refresh, so it avoids shared OIDC session invalidation.
us-east-1 by default).curl -X POST http://localhost:20128/api/oauth/kiro/api-key \
-H "Content-Type: application/json" \
-d '{"apiKey": "kiro_or_codewhisperer_key", "region": "us-east-1"}'
The API route validates the key by calling KiroService.validateApiKey(), which
uses ListAvailableProfiles against the region-matched CodeWhisperer/Amazon Q
endpoint and resolves a profileArn.
The saved connection uses:
{
"authType": "apikey",
"providerSpecificData": {
"authMethod": "api_key",
"region": "us-east-1",
"profileArn": "arn:aws:codewhisperer:..."
}
}
At runtime, KiroExecutor.buildHeaders() sends the key as
Authorization: Bearer <key> and adds tokentype: API_KEY. Quota/profile calls
use the same marker so AWS treats the bearer as a long-lived API key rather than
an OIDC or social access token.
AWS SSO OIDC public clients typically expire after 90 days
(clientSecretExpiresAt). OmniRoute stores this timestamp in providerSpecificData
for observability. If a connection stops refreshing after ~90 days, re-import the
connection to obtain a fresh OIDC client registration. Automatic re-registration on
expiry is tracked as a future improvement.
API-key connections do not have OIDC client expiry because they do not refresh through AWS SSO OIDC.
clientId in its raw JSON (visible via the info icon). If either connection is missing
clientId, it was imported before v3.8.0 — re-import it.aorAAAAAG.https://oidc.us-east-1.amazonaws.com (or the configured
region). If you are behind a corporate proxy, set a provider-level proxy in
Dashboard → Settings → Proxies.us-east-1 is the default.ListAvailableProfiles; otherwise OmniRoute cannot
resolve the required profileArn.For other issues, see the main TROUBLESHOOTING.md.