Refused to create a worker

            _logger.LogInformation("Generating Zoom signature for session: {SessionName}, role: {Role}", sessionName, role);

            var storeScope = await _storeContext.GetActiveStoreScopeConfigurationAsync();
            var zoomMeetingSettings = await _settingService.LoadSettingAsync<ZoomMeetingSettings>(storeScope);

            var sdkKey = zoomMeetingSettings.SDKKey;
            var sdkSecret = zoomMeetingSettings.SDKSecret;

            var now = DateTimeOffset.UtcNow;
            var iat = now.ToUnixTimeSeconds();
            var exp = now.AddMinutes(30).ToUnixTimeSeconds(); 

            var header = new JwtHeader(new SigningCredentials(
                new SymmetricSecurityKey(Encoding.UTF8.GetBytes(sdkSecret)),
                SecurityAlgorithms.HmacSha256));

            var payload = new JwtPayload
            {
                { "app_key", sdkKey }, 
                { "tpc", sessionName }, 
                { "role_type", role }, 
                { "version", 1 }, 
                { "iat", iat },
                { "exp", exp } 
            };

            var token = new JwtSecurityToken(header, payload);
            var handler = new JwtSecurityTokenHandler();
            _logger.LogInformation("Zoom signature generated successfully for session: {SessionName}", sessionName);

            string jwt = handler.WriteToken(token);
            
            return jwt;

Hello,
using c# code to generate the JWT I get this error, any help?
thank you
tp.min.js:1 Refused to create a worker from ‘blob:https://localhost:4435/db64b9d5-f763-470b-9ae4-80125ea9d5d6’ because it violates the following Content Security Policy directive: “script-src * ‘unsafe-inline’ ‘unsafe-eval’”. Note that ‘worker-src’ was not explicitly set, so ‘script-src’ is used as a fallback. Note that ‘*’ matches only URLs with network schemes (‘http’, ‘https’, ‘ws’, ‘wss’), or URLs whose scheme matches self’s scheme. The scheme ‘blob:’ must be added explicitly.

Hey @khedr.developer

Thanks for your feedback.

This might be caused by an incompatibility between the Content Security Policy (CSP) on your web server and the Video SDK Web. You can refer to the documentation to add the appropriate rules to your CSP configuration.

Thanks
Vic

2 Likes

This topic was automatically closed 25 hours after the last reply. New replies are no longer allowed.