{"record":{"id":"c07e6a3a5b33b343","repo":"mgth/LittleBigMouse","slug":"vidaa-rejected-every-authentication-variant-for-protocol","errorCode":null,"errorMessage":"VIDAA rejected every authentication variant for protocol {protocol} and controller {identity}. Check the projector date, time and timezone.","messagePattern":"VIDAA rejected every authentication variant for protocol (.+?) and controller (.+?)\\. Check the projector date, time and timezone\\.","errorType":"exception","errorClass":"UnauthorizedAccessException","httpStatus":null,"severity":"error","filePath":"LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/HisenseVidaa/VidaaPairing.cs","lineNumber":165,"sourceCode":"\n                configuration.DeviceUuid = candidate;\n                configuration.AuthMethod = method;\n                configuration.ClientId = credentials.ClientId;\n                configuration.MqttUsername = credentials.Username;\n                configuration.AccessToken = \"\";\n                configuration.RefreshToken = \"\";\n\n                _ = responses.PinAccepted.Expect();\n                _ = responses.TokenIssued.Expect();\n                if (requestPin)\n                    await session.PublishAsync(\n                        HisenseVidaaProtocol.Topic(\"ui_service\", configuration.ClientId, \"vidaa_app_connect\"),\n                        HisenseVidaaProtocol.PairingRequestPayload(), cancellationToken).ConfigureAwait(false);\n                return;\n            }\n\n        var protocol = configuration.ProtocolVersion?.ToString() ?? \"unknown\";\n        throw new UnauthorizedAccessException(\n            $\"VIDAA rejected every authentication variant for protocol {protocol} and controller {identity}. \" +\n            \"Check the projector date, time and timezone.\", lastAuthorizationError);\n    }\n\n    string NormalizedBrand()\n    {\n        var brand = configuration.Brand.Trim().ToLowerInvariant();\n        return string.IsNullOrWhiteSpace(brand) || brand.Contains(\"hisense\", StringComparison.Ordinal)\n            ? \"his\"\n            : brand;\n    }\n\n    string PairingIdentity()\n    {\n        var configured = HisenseVidaaProtocol.NormalizeMac(configuration.DeviceUuid, preserveCase: true);\n        if (configured.Count(Uri.IsHexDigit) == 12) return configured;\n        return HisenseVidaaProtocol.NormalizeMac(configuration.ControllerMacAddress, preserveCase: true);\n    }","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/mgth/LittleBigMouse/blob/7a42f01d47d99d223b8ee33ba4019af82adf1c48/LittleBigMouse.Plugins/LittleBigMouse.Plugin.Vcp.Avalonia/HisenseVidaa/VidaaPairing.cs#L147-L183","documentation":"StartDynamicAsync exhausts every authentication/pairing variant the protocol offers and the device still refuses authorization. The library throws UnauthorizedAccessException with the last protocol version and controller identity so the developer can see which combination failed, and explicitly hints that clock skew is a common cause since VIDAA validates request timestamps/signatures.","triggerScenarios":"Calling StartAsync (which delegates to StartDynamicAsync) on a newer VIDAA device where the pairing request, app-connect handshake and all fallback auth payloads are rejected; wrong ProtocolVersion configured; controller identity not recognized by the device.","commonSituations":"Projector/TV system clock wrong or in the wrong timezone so signed requests fall outside the accepted window; firmware update changed the pairing protocol; misconfigured ProtocolVersion in connection settings; device paired to another controller.","solutions":["Verify the projector's date, time and timezone (Settings > System) and NTP sync, then retry pairing","Confirm configuration.ProtocolVersion matches the device firmware generation; unset it to let the library probe variants","Re-run the full pairing flow from scratch (delete stored pairing first)","Check the device isn't already paired to a different controller/app and clear old pairings on the device","Capture lastAuthorizationError (InnerException) for the device's actual rejection reason"],"exampleFix":"// before\nconfiguration.ProtocolVersion = 5; // guessed\nawait session.StartAsync(ct);\n// after\nconfiguration.ProtocolVersion = null; // let StartDynamicAsync probe variants\nawait session.StartAsync(ct);","handlingStrategy":"try-catch","validationCode":"// sanity-check device clock reachability and config before pairing\nif (string.IsNullOrEmpty(configuration.ClientId))\n    throw new InvalidOperationException(\"ClientId required for pairing\");","typeGuard":null,"tryCatchPattern":"try\n{\n    await session.StartAsync(ct);\n}\ncatch (UnauthorizedAccessException ex)\n{\n    logger.LogError(ex, \"VIDAA pairing rejected; check device date/time/timezone and ProtocolVersion\");\n    // surface the lastAuthorizationError inner exception to the user\n}","preventionTips":["Keep the projector's clock synced via NTP and correct timezone","Don't hardcode ProtocolVersion; let the library probe or match it to firmware","Clear stale pairings on both sides before re-pairing","Log and inspect lastAuthorizationError to see the device's rejection reason"],"tags":["csharp","authentication","mqtt","hisense-vidaa","clock-skew"],"backgroundTag":"authentication-required","analyzedSha":"7a42f01d47d99d223b8ee33ba4019af82adf1c48","analyzedAt":"2026-09-16T00:35:00.514Z","contentChangedAt":"2026-09-16T00:35:00.514Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}