diegosouzapw/OmniRoute · error

Failed to register client

Error message

Failed to register client: ${error}

What it means

KiroService.registerClient: the POST to https://oidc.<region>.amazonaws.com/client/register with clientName/clientType/scopes/grantTypes/issuerUrl returned non-ok; the AWS error body is appended. Means AWS SSO OIDC refused to register the OIDC client — invalid issuerUrl for the region, throttling, or an AWS-side fault.

Solutions

  1. Read the appended AWS error (InvalidRequestException, ThrottlingException...)
  2. Verify issuerUrl matches the Kiro Builder ID issuer for the region
  3. On throttling, retry with exponential backoff
  4. Confirm the region is a valid AWS region accepted by assertValidAwsRegion
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/lib/oauth/services/kiro.ts:43 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/c3b5732f795ea382. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/oauth/services/kiro.ts:43

    const endpoint = `https://oidc.${region}.amazonaws.com/client/register`;

    const response = await fetch(endpoint, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        clientName: KIRO_CONFIG.clientName,
        clientType: KIRO_CONFIG.clientType,
        scopes: KIRO_CONFIG.scopes,
        grantTypes: KIRO_CONFIG.grantTypes,
        issuerUrl: KIRO_CONFIG.issuerUrl,
      }),
    });

    if (!response.ok) {
      const error = await response.text();
      throw new Error(`Failed to register client: ${error}`);
    }

    const data = await response.json();
    return {
      clientId: data.clientId,
      clientSecret: data.clientSecret,
      clientSecretExpiresAt: data.clientSecretExpiresAt,
    };
  }

  /**
   * Start device authorization for AWS Builder ID or IDC
   */
  async startDeviceAuthorization(
    clientId: string,
    clientSecret: string,
    startUrl: string,
    region: string = "us-east-1"

View on GitHub (pinned to a179ffed5b)