{"record":{"id":"aa33a269c66b93ed","repo":"BeyondDimension/SteamTools","slug":"no-shared-secret","errorCode":null,"errorMessage":"no shared_secret","messagePattern":"no shared_secret","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"warning","filePath":"src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamGuardImportPageViewModel.cs","lineNumber":99,"sourceCode":"                    return;\n                }\n            else\n                deviceId = PhoneImportUuid;\n\n            if (string.IsNullOrEmpty(deviceId) || DeviceIdRegex().IsMatch(deviceId) == false)\n                //WinAuthForm.ErrorDialog(this, \"Invalid deviceid, expecting \\\"android:NNNN...\\\"\");\n                return;\n\n            // check the steamguard\n            byte[] secret;\n            string? serial;\n            var steamGuardModel = SJsonSerializer.Deserialize(PhoneImportSteamGuard,\n                ImportFileModelJsonContext.Default.SteamGuardModel);\n\n            if (steamGuardModel == null) return;\n\n            if (string.IsNullOrEmpty(steamGuardModel.SharedSecret))\n                throw new ApplicationException(\"no shared_secret\");\n\n            secret = Convert.FromBase64String(steamGuardModel.SharedSecret);\n\n            if (string.IsNullOrEmpty(steamGuardModel.SerialNumber))\n                throw new ApplicationException(\"no serial_number\");\n\n            serial = steamGuardModel.SerialNumber;\n\n            var auth = new SteamAuthenticator\n            {\n                SecretKey = secret,\n                Serial = serial,\n                SteamData = PhoneImportSteamGuard,\n                DeviceId = deviceId,\n            };\n\n            await AuthenticatorHelper.SaveAuthenticator(new AuthenticatorDTO\n            {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/BeyondDimension/SteamTools/blob/c16ffa08e03b192d23ada290c4969e77f9201f3d/src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamGuardImportPageViewModel.cs#L81-L117","documentation":"Thrown during Steam Guard (json) import when the deserialized SteamGuardModel has an empty/null SharedSecret. The shared secret is required to generate Steam TOTP codes locally, so without it the model cannot be turned into a SteamAuthenticator.","triggerScenarios":"Importing a Steam Guard JSON blob (PhoneImportSteamGuard) where the 'shared_secret' field is absent or empty after deserialization.","commonSituations":"Export from a tool that only stored 'secret' (confidential) but not 'shared_secret'; JSON truncated/redacted; wrong file selected for import; Steam Guard model schema mismatch (field renamed).","solutions":["Re-export the Steam Guard data ensuring 'shared_secret' is included (it must come from a rooted device/official export).","Confirm the selected JSON file is a Steam Guard export and not another authenticator's file.","If shared_secret is genuinely unavailable, Steam TOTP cannot be reproduced locally — inform the user.","Validate the field in the UI and list which required fields are missing."],"exampleFix":"// before\nif (string.IsNullOrEmpty(steamGuardModel.SharedSecret))\n    throw new ApplicationException(\"no shared_secret\");\n\n// after: collect all missing fields, report once\nvar missing = new List<string>();\nif (string.IsNullOrEmpty(steamGuardModel.SharedSecret)) missing.Add(\"shared_secret\");\nif (string.IsNullOrEmpty(steamGuardModel.SerialNumber)) missing.Add(\"serial_number\");\nif (missing.Count > 0)\n    throw new ArgumentException($\"Steam Guard import missing: {string.Join(\", \", missing)}\");","handlingStrategy":"validation","validationCode":"var model = SJsonSerializer.Deserialize(json, ImportFileModelJsonContext.Default.SteamGuardModel);\nif (model == null) { errors.Add(\"Steam Guard file is empty or unparseable.\"); return; }\nif (string.IsNullOrWhiteSpace(model.SharedSecret))\n    errors.Add(\"Steam Guard import missing 'shared_secret'.\");","typeGuard":"bool HasSharedSecret(SteamGuardModel? m) => !string.IsNullOrWhiteSpace(m?.SharedSecret);","tryCatchPattern":"try { ImportSteamGuard(json); }\ncatch (ApplicationException ex) when (ex.Message == \"no shared_secret\")\n{\n    importErrors.Add(\"Steam Guard file lacks 'shared_secret'; cannot generate codes locally.\");\n}","preventionTips":["Validate all required Steam Guard fields (shared_secret, serial_number, device_id) up front.","Report every missing field in one message to avoid repeated import attempts.","Only accept Steam Guard exports from trusted/rooted sources that include shared_secret.","Schema-check the JSON before deserialization to catch renamed/missing fields."],"tags":["authenticator","steam","import","validation"],"backgroundTag":null,"analyzedSha":"c16ffa08e03b192d23ada290c4969e77f9201f3d","analyzedAt":"2026-08-13T11:52:20.410Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}