How to encode our user using JWT.IO lib ?

For better security, we do recommend using this method to encode your user data.
Your webmaster id param is 1 and you password is yareka123456!

List of Parameters to be encoded

webmasterid*: your webmasterid token

password*: your password

username*: username of the user

gender: Gender of user: must fit the genders defined in chatadmin - : male, female, couple By default is male

role: Role of the user: can be : admin, moderator, dj, user By default is user

image:Image or Avatar of the user : must be a link (https) to url of an image By default is random avatar

defaultRoom: Default room when enter the chat By default is the first room

So you do create your user like in php as an array:

        
            $password = 'yareka123456!';
            $user = array('webmasterid'=>1, 'password'=>$password, 'username'=>'John', 'gender'=>'male', 'role'=>'user', 'image'=>'https://html5-chat.com/img/avatars/m/13.svg');
        
Then you need to create an encrypted TOKEN from that user.
For that, we use jwt.io library
For PHP, we use for instance: https://github.com/firebase/php-jwt (if you use another langage, pick your library from jwt.io

Let do it with PHP


Step1: encode the user with JWT::encode

Create the $user array and encode it

    $password = 'yareka123456!';
    $user = array('webmasterid'=>1, 'password'=>$password, 'username'=>'John', 'gender'=>'male', 'role'=>'user', 'image'=>'https://html5-chat.com/img/avatars/m/13.svg');
    $encodedUser = JWT::encode($user, $password);


As result, $encodedUser will contain base64 long encrypted string (encryptedUser)
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3ZWJtYXN0ZXJpZCI6MSwicGFzc3dvcmQiOiJ5YXJla2ExMjM0NTYhIiwidXNlcm5hbWUiOiJKb2huIiwiZ2VuZGVyIjoibWFsZSIsInJvbGUiOiJ1c2VyIiwiaW1hZ2UiOiJodHRwczpcL1wvaHRtbDUtY2hhdC5jb21cL2ltZ1wvYXZhdGFyc1wvbVwvMTMuc3ZnIn0.suFZnwn8eWdU3V4k9acW9scnrHjNFTtUnoTt6RUpevk

Step2 : use that encoded script into your script

The pattern is:

        https://html5-chat.com/chat/{webmasterid}/{encryptedUser}
    

Directly to access your chat with link
            
                https://html5-chat.com/1/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3ZWJtYXN0ZXJpZCI6MSwicGFzc3dvcmQiOiJ5YXJla2ExMjM0NTYhIiwidXNlcm5hbWUiOiJKb2huIiwiZ2VuZGVyIjoibWFsZSIsInJvbGUiOiJ1c2VyIiwiaW1hZ2UiOiJodHRwczpcL1wvaHRtbDUtY2hhdC5jb21cL2ltZ1wvYXZhdGFyc1wvbVwvMTMuc3ZnIn0.suFZnwn8eWdU3V4k9acW9scnrHjNFTtUnoTt6RUpevk            
        
Integrate your chat with a script:
            
                <script src="https://html5-chat.com/script/1/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3ZWJtYXN0ZXJpZCI6MSwicGFzc3dvcmQiOiJ5YXJla2ExMjM0NTYhIiwidXNlcm5hbWUiOiJKb2huIiwiZ2VuZGVyIjoibWFsZSIsInJvbGUiOiJ1c2VyIiwiaW1hZ2UiOiJodHRwczpcL1wvaHRtbDUtY2hhdC5jb21cL2ltZ1wvYXZhdGFyc1wvbVwvMTMuc3ZnIn0.suFZnwn8eWdU3V4k9acW9scnrHjNFTtUnoTt6RUpevk"></script>