Byrd — Chat & Sockets — Authentication

Introduction

As I mentioned earlier, I was arguing with myself on using either WebSockets which I am familiar with, or FireBase, which I got little idea of, but that’d shorten my development time, and would give me alot of performance advantages. Right. It would.

Doubts…

I was fighting with the thought of going the simplest way — not adding any sort of authentication here, except the agents, as this chat module would be used by the visitors. But the truth is — that wouldn’t be a good idea, as literally anybody would have access to every single chat out there. That could lead to abuse.

Solution

So I came up with using tokens for all the users out there. But the guest has to get the token somehow, and since he’s not authenticated with login form, I decided to generate a guest token, on every, single chat initiation.

--

--

Software Engineer. Email me at me@polethedev.com

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store