{"record":{"id":"6688cf03c2e8fe4a","repo":"medusajs/medusa","slug":"github-clientsecret-is-required","errorCode":null,"errorMessage":"Github clientSecret is required","messagePattern":"Github clientSecret is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/modules/providers/auth-github/src/services/github.ts","lineNumber":33,"sourceCode":"  logger: Logger\n}\n\ninterface LocalServiceConfig extends GithubAuthProviderOptions {}\n\nexport class GithubAuthService extends AbstractAuthModuleProvider {\n  static identifier = \"github\"\n  static DISPLAY_NAME = \"Github Authentication\"\n\n  protected config_: LocalServiceConfig\n  protected logger_: Logger\n\n  static validateOptions(options: GithubAuthProviderOptions) {\n    if (!options.clientId) {\n      throw new Error(\"Github clientId is required\")\n    }\n\n    if (!options.clientSecret) {\n      throw new Error(\"Github clientSecret is required\")\n    }\n\n    if (!options.callbackUrl) {\n      throw new Error(\"Github callbackUrl is required\")\n    }\n  }\n\n  constructor(\n    { logger }: InjectedDependencies,\n    options: GithubAuthProviderOptions\n  ) {\n    // @ts-ignore\n    super(...arguments)\n    this.config_ = options\n    this.logger_ = logger\n  }\n\n  async register(_): Promise<AuthenticationResponse> {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/modules/providers/auth-github/src/services/github.ts#L15-L51","documentation":"The Github auth provider requires a `clientSecret` alongside the clientId to complete the OAuth code exchange. `validateOptions` throws at startup when it is missing.","triggerScenarios":"Registering the github auth provider with a clientId but no clientSecret, or the GITHUB_CLIENT_SECRET env var not being set.","commonSituations":"Client secret not generated/copied from the Github OAuth app settings, secret stripped from the environment for security without replacement, or trailing whitespace/newline in the pasted secret breaking env parsing.","solutions":["Set clientSecret in provider options from GITHUB_CLIENT_SECRET","Verify the env var value matches the OAuth app's client secret exactly (no quotes/whitespace)"],"exampleFix":"// before\noptions: { clientId: process.env.GITHUB_CLIENT_ID }\n// after\noptions: { clientId: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET, callbackUrl: process.env.GITHUB_CALLBACK_URL }","handlingStrategy":"validation","validationCode":"for (const k of ['GITHUB_CLIENT_ID', 'GITHUB_CLIENT_SECRET', 'GITHUB_CALLBACK_URL']) {\n  if (!process.env[k]) throw new Error(`Missing env var: ${k}`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate all three github options together in one config check","Rotate and re-copy secrets carefully without whitespace"],"tags":["github","oauth","auth-provider","module-config","startup"],"backgroundTag":"oauth-provider-misconfigured","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}