HeyPuter/puter · error · HttpError

not_found

not_found

Error message

Provider not configured.

What it means

`GET /auth/oidc/:provider/start` resolves the provider name from the URL path and looks up its configuration via `services.oidc.getProviderConfig()`. If no config exists for that provider ID, the endpoint returns 404. This means the provider is not enabled or the name is misspelled.

Source

Thrown at src/backend/controllers/oidc/OIDCController.ts:272

                res.json({ providers });
            },
        );

        // -- GET /auth/oidc/:provider/start --------------------------
        // Redirect user to IdP authorization endpoint.

        router.get(
            '/auth/oidc/:provider/start',
            {
                subdomain: '',
                rateLimit: { scope: 'oidc-general', limit: 30, window: 60_000 },
            },
            async (req: Request, res: Response) => {
                const provider = String(req.params.provider);
                const cfg =
                    await this.services.oidc.getProviderConfig(provider);
                if (!cfg)
                    throw new HttpError(404, 'Provider not configured.', {
                        legacyCode: 'not_found',
                    });

                const flow = String(
                    Array.isArray(req.query.flow)
                        ? req.query.flow[0]
                        : (req.query.flow ?? 'login'),
                );
                const origin = (this.config.origin ?? '').replace(/\/$/, '');

                const flowRedirects: Record<string, string> = {
                    login: origin || '/',
                    signup: origin || '/',
                    revalidate: `${origin}/auth/revalidate-done`,
                };

                let appRedirectUri = flowRedirects[flow] ?? (origin || '/');

View on GitHub (pinned to 908ec23eda)

Solutions

  1. Check the enabled providers via `GET /auth/oidc/providers` and use only those IDs.
  2. Verify the provider slug matches the config key exactly (case-sensitive).
  3. If the provider should be available, add its config (client_id, client_secret, issuer URL) to the OIDC configuration.
  4. Update the frontend to fetch the provider list dynamically rather than hardcoding.

Example fix

// before — hardcoded provider link
`/auth/oidc/google/start`

// after — fetch enabled providers first
const { providers } = await fetch('/api/auth/oidc/providers').then(r => r.json());
// providers: ['github', 'microsoft']
`/auth/oidc/${providers[0]}/start`
Defensive patterns

Strategy: validation

Validate before calling

// Fetch the enabled provider list before linking
const res = await fetch('/api/auth/oidc/providers');
const { providers } = await res.json();
// providers: ['github', 'microsoft', ...]
if (!providers.includes(requestedProvider)) {
  console.error(`Provider '${requestedProvider}' is not available`);
  return;
}

Type guard

/** @param {unknown} v @returns {v is string[]} */
function isStringArray(v) {
  return Array.isArray(v) && v.every(x => typeof x === 'string');
}

Try / catch

try {
  window.location = `/auth/oidc/${provider}/start`;
} catch (e) {
  if (e.code === 'not_found') {
    showProviderList(); // refresh available providers
  }
}

Prevention

When it happens

Trigger: Navigating to `/auth/oidc/google/start` when only `github` is configured; a typo in the provider slug; the provider was disabled in config after the frontend cached the link.

Common situations: Frontend hardcodes a provider list that drifts from the server config; a user bookmarks an old provider link; provider config was removed during a deployment but the UI wasn't updated.

Related errors


AI-assisted analysis of HeyPuter/puter@908ec23eda (2026-08-12). Data as JSON: /api/errors/c4b4101a7540684b. Report an issue: GitHub.