decolua/9router · error · Error

`Client registration failed: ${error}`

Error message

`Client registration failed: ${error}`

What it means

Thrown by the Kiro OAuth provider during step 1 of its device login: the dynamic client registration request (POST with issuerUrl) returned non-2xx, so no clientInfo exists for the subsequent device-authorization call. The raw upstream error body is included in the message.

Source

Thrown at src/lib/oauth/providers/kiro.js:36

    // Step 1: Register client with AWS SSO OIDC
    const registerRes = await fetch(registerClientUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
      },
      body: JSON.stringify({
        clientName: config.clientName,
        clientType: config.clientType,
        scopes: config.scopes,
        grantTypes: config.grantTypes,
        issuerUrl: config.issuerUrl,
      }),
    });

    if (!registerRes.ok) {
      const error = await registerRes.text();
      throw new Error(`Client registration failed: ${error}`);
    }

    const clientInfo = await registerRes.json();

    // Step 2: Request device authorization
    const deviceRes = await fetch(deviceAuthUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
      },
      body: JSON.stringify({
        clientId: clientInfo.clientId,
        clientSecret: clientInfo.clientSecret,
        startUrl,
      }),
    });

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Read the embedded response body in the message for the upstream rejection reason.
  2. Verify config.issuerUrl points at the current, correct Kiro issuer endpoint.
  3. Test the registration endpoint reachability with curl using the same payload.
  4. Retry later if the body/status indicates a server-side outage (5xx).

Example fix

// before
issuerUrl: 'https://old-kiro-endpoint.example.com'
// after
issuerUrl: 'https://current-kiro-issuer.example.com'  // update to the current issuer
Defensive patterns

Strategy: retry

Try / catch

try {
  await kiroProvider.login(config);
} catch (e) {
  if (e.message.startsWith('Client registration failed:')) {
    // inspect embedded body; verify issuerUrl, then retry with backoff for 5xx
  } else throw e;
}

Prevention

When it happens

Trigger: The Kiro client-registration endpoint rejects the request: bad/expired config.issuerUrl, registration service rejecting the client metadata, 5xx on the registration service, or network interception of the request.

Common situations: Stale config.issuerUrl after an AWS/Kiro endpoint change; registration endpoint temporarily down; proxy stripping or mangling the registration POST body; regional endpoint unreachable.

Related errors


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/033a9ca7070cd221. Report an issue: GitHub.