fix(kiro): refresh imported social tokens via social-auth, not AWS OIDC (#2467)

This commit is contained in:
diegosouzapw
2026-05-21 10:54:23 -03:00
parent f47531bd47
commit 69a80d3ee4
3 changed files with 50 additions and 4 deletions

View File

@@ -184,8 +184,10 @@ export class KiroService {
async refreshToken(refreshToken: string, providerSpecificData: any = {}) {
const { authMethod, clientId, clientSecret, region } = providerSpecificData;
// AWS SSO OIDC refresh (Builder ID or IDC)
if (clientId && clientSecret) {
// AWS SSO OIDC refresh (Builder ID or IDC).
// Imported social tokens (authMethod === "imported") have a registered clientId/clientSecret
// but a Kiro-social refresh token the OIDC client can't refresh — use the social path (#2467).
if (clientId && clientSecret && authMethod !== "imported") {
const endpoint = `https://oidc.${region || "us-east-1"}.amazonaws.com/token`;
const response = await fetch(endpoint, {