{"record":{"id":"fc47e90e5a57894d","repo":"medusajs/medusa","slug":"oidc-provider-requires-a-client-id-option","errorCode":null,"errorMessage":"OIDC provider requires a 'client_id' option","messagePattern":"OIDC provider requires a 'client_id' option","errorType":"validation","errorClass":"MedusaError","httpStatus":400,"severity":"critical","filePath":"packages/modules/providers/auth-oidc/src/services/oidc.ts","lineNumber":44,"sourceCode":"  static identifier = \"oidc\"\n  static DISPLAY_NAME = \"OpenID Connect\"\n\n  protected readonly config_: OidcAuthProviderOptions\n  protected readonly logger_: Logger\n  protected readonly engine_: OidcEngine\n\n  static validateOptions(options: OidcAuthProviderOptions) {\n    if (!options.issuer) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_DATA,\n        \"OIDC provider requires an 'issuer' option\"\n      )\n    }\n\n    assertSecureUrl(options.issuer, \"issuer\")\n\n    if (!options.client_id) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_DATA,\n        \"OIDC provider requires a 'client_id' option\"\n      )\n    }\n\n    if (!options.callback_url) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_DATA,\n        \"OIDC provider requires a 'callback_url' option\"\n      )\n    }\n  }\n\n  constructor(\n    { logger, cache }: InjectedDependencies,\n    options: OidcAuthProviderOptions\n  ) {\n    // @ts-ignore","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-oidc/src/services/oidc.ts#L26-L62","documentation":"validateOptions throws INVALID_DATA when client_id is absent. The client_id identifies your application to the identity provider and is required for both the authorization and token endpoints.","triggerScenarios":"Provider options in medusa-config.js omit client_id, or it is set from an env var that resolves to undefined.","commonSituations":"Copied the OAuth client credentials from the wrong panel field (using the provider's app ID instead of the OAuth client ID); env var missing in CI/production while working locally; the IdP project was recreated and the old client_id removed.","solutions":["Add client_id to the provider options using the OAuth client ID from your IdP app registration.","Verify the env var is exported in the environment Medusa runs in (not just your shell).","Cross-check against the IdP's credentials page; regenerate/rotate if the client was deleted."],"exampleFix":"// before\noptions: { issuer: \"...\", callback_url: \"...\" }\n// after\noptions: { issuer: \"...\", client_id: process.env.OIDC_CLIENT_ID, callback_url: \"...\" }","handlingStrategy":"validation","validationCode":"if (!process.env.OIDC_CLIENT_ID) {\n  throw new Error(\"OIDC_CLIENT_ID is not set; cannot configure the oidc auth provider\")\n}","typeGuard":"const hasClientId = (o: Partial<OidcAuthProviderOptions>): o is OidcAuthProviderOptions =>\n  typeof o.client_id === \"string\" && o.client_id.length > 0","tryCatchPattern":"try { OidcAuthService.validateOptions(options) } catch (e) { if (e instanceof MedusaError && /'client_id'/.test(e.message)) { /* report missing credential */ } throw e }","preventionTips":["Store client_id/client_secret as env vars in a secrets manager.","Add a pre-deploy check that all OIDC env vars are present.","Rotate credentials on both sides simultaneously."],"tags":["oidc","configuration","startup","auth-provider"],"backgroundTag":"missing-config-option","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}