{"record":{"id":"4accfb152e8dcb94","repo":"Devolutions/UniGetUI","slug":"github-sign-in-is-not-configured-for-this-build-u","errorCode":null,"errorMessage":"GitHub sign-in is not configured for this build. UNIGETUI_GITHUB_CLIENT_ID is missing.","messagePattern":"GitHub sign-in is not configured for this build\\. UNIGETUI_GITHUB_CLIENT_ID is missing\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/UniGetUI.Interface.IpcApi/IpcBackupApi.cs","lineNumber":469,"sourceCode":"        {\n            Logger.Warn(ex);\n        }\n\n        return auth;\n    }\n\n    private static bool HasConfiguredGitHubClient()\n    {\n        string clientId = Secrets.GetGitHubClientId();\n        return !string.IsNullOrWhiteSpace(clientId)\n            && !string.Equals(clientId, MissingClientId, StringComparison.Ordinal);\n    }\n\n    private static void EnsureGitHubClientConfigured()\n    {\n        if (!HasConfiguredGitHubClient())\n        {\n            throw new InvalidOperationException(\n                \"GitHub sign-in is not configured for this build. UNIGETUI_GITHUB_CLIENT_ID is missing.\"\n            );\n        }\n    }\n\n    private static GitHubApiClient CreateAnonymousGitHubClient()\n    {\n        return new GitHubApiClient();\n    }\n\n    private static GitHubApiClient CreateAuthenticatedGitHubClient(string? token = null)\n    {\n        token ??= SecureGHTokenManager.GetToken();\n        if (string.IsNullOrWhiteSpace(token))\n        {\n            throw new InvalidOperationException(\"GitHub authentication is required for cloud backups.\");\n        }\n","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/Devolutions/UniGetUI/blob/9b1d7d0eab91620fc15c86b36676532095936ae3/src/UniGetUI.Interface.IpcApi/IpcBackupApi.cs#L451-L487","documentation":"EnsureGitHubClientConfigured checks HasConfiguredGitHubClient, which reads Secrets.GetGitHubClientId() and returns false if the value is blank or equals the literal placeholder \"CLIENT_ID_UNSET\". When false, any GitHub sign-in attempt (StartGitHubDeviceFlowAsync, CompleteGitHubDeviceFlowAsync) throws InvalidOperationException before contacting GitHub. This is a build-time configuration gate: the OAuth client ID must be baked in via the secrets generation step.","triggerScenarios":"A build of UniGetUI was produced without running the secrets-generation script (src/UniGetUI.Avalonia/Infrastructure/generate-secrets.ps1), so UNIGETUI_GITHUB_CLIENT_ID is unset or set to the placeholder. Any call to StartGitHubDeviceFlowAsync or CompleteGitHubDeviceFlowAsync triggers the guard.","commonSituations":"A developer build without secrets configured. A CI build that skipped the secrets step. A self-compiled build where the user did not provide a GitHub OAuth App client ID. The secrets file was deleted or the embedded resource is missing.","solutions":["Run the secrets generation script (src/UniGetUI.Avalonia/Infrastructure/generate-secrets.ps1) with a valid UNIGETUI_GITHUB_CLIENT_ID before building.","Register a GitHub OAuth App and use its client ID as the value.","Verify Secrets.GetGitHubClientId() returns a non-placeholder value after rebuild.","Check HasConfiguredGitHubClient() / IpcGitHubAuthInfo.ClientConfigured at runtime before offering sign-in."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var status = await IpcBackupApi.GetStatusAsync();\nif (!status.Auth.ClientConfigured)\n    throw new InvalidOperationException(\"Build is missing GitHub client ID; run generate-secrets.ps1\");","typeGuard":"static bool IsGitHubClientConfigured(IpcGitHubAuthInfo auth) => auth.ClientConfigured;","tryCatchPattern":"try { await IpcBackupApi.StartGitHubDeviceFlowAsync(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"CLIENT_ID\"))\n{ /* build was not configured with a GitHub OAuth client ID */ }","preventionTips":["Run generate-secrets.ps1 with a valid UNIGETUI_GITHUB_CLIENT_ID before building.","Check IpcGitHubAuthInfo.ClientConfigured before offering sign-in UI.","Register a GitHub OAuth App to obtain the client ID."],"tags":["github","configuration","secrets","build","authentication","ipc"],"backgroundTag":null,"analyzedSha":"9b1d7d0eab91620fc15c86b36676532095936ae3","analyzedAt":"2026-08-13T12:19:18.278Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}