# WebGL Authentication : Insecure connection not allowed

**URL:** <https://forum.heroiclabs.com/t/webgl-authentication-insecure-connection-not-allowed/5404>\
**Category:** Client Libraries\
**Tags:** authentication\
**Created:** [July 1, 2024, 3:05pm UTC](https://forum.heroiclabs.com/t/webgl-authentication-insecure-connection-not-allowed/5404 "2024-07-01T15:05:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KGS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/kgs/32/1517_2.png) [@KGS](https://forum.heroiclabs.com/u/KGS)\
**Post date:** [July 1, 2024, 3:05pm UTC](https://forum.heroiclabs.com/t/webgl-authentication-insecure-connection-not-allowed/5404/1 "2024-07-01T15:05:18Z")

</div>

Hi I’m Developed Unity Webgl game. Its work fine when its work on Editor/Mobile  
but its not work in Webgl  
the error i get

```auto
       m_Client = new Client("http", m_Host,7350, "defaultkey",UnityWebRequestAdapter.Instance);

```

Code

```auto
    public async void LoginWithGuest()
    {
        authenticationType = AuthenticationType.Guest;
        if (m_DeviceId == "")
        {
            m_DeviceId = SystemInfo.deviceUniqueIdentifier;
        }
        try
            {
            // User already Exists
                m_Session = await m_Client.AuthenticateDeviceAsync(m_DeviceId, create: false);
                PlayerPrefs.SetString("nakama.refreshToken", m_Session.RefreshToken);
                PlayerPrefs.SetString("nakama.authToken", m_Session.AuthToken);
                Debug.Log(m_Session);
            }
            catch (Exception e)
            {
                Debug.LogError("New User Found");
                try
                {
                    m_Session = await m_Client.AuthenticateDeviceAsync(m_DeviceId, create: true);
                    PlayerPrefs.SetString("nakama.refreshToken", m_Session.RefreshToken);
                    PlayerPrefs.SetString("nakama.authToken", m_Session.AuthToken);
                }
                catch (Exception ex)
                {
                    Debug.LogError("Error on creating new user "+m_Client );
                    Debug.LogError("Message "+ ex.Message);
                }
            }

    }

```
