Firebase authentication in WebGL

Hi. I’ll start by saying that I have no prior experience with Firebase, looked through some tutorials using the Firebase Unity SDK and it looked quite interesting and understandable. That’s until I realised that the Firebase Unity SDK doesn’t work with WebGL builds.

I need to use firebase authentication in a WebGL application and the tutorials I’ve found don’t work. I stumbled upon some information that it is possible to use the Firebase Javascript SDK to use Firebase inside WebGL and now I’m wondering, is it possible to use this information authenticate users in WebGL apps?

If so, where should I start looking for more information or guidelines?

Thanks in advance

1 Like

Yes it can be done.

Do your auth in Javascript - জাভাস্ক্রিপ্ট ব্যবহার করে পাসওয়ার্ড-ভিত্তিক অ্যাকাউন্ট ব্যবহার করে ফায়ারবেসের সাথে প্রমাণীকরণ করুন  |  Firebase

Get the Id Token using User.GetIdToken - https://firebase.google.com/docs/reference/js/firebase.User#getidtoken

Send the Id token through to Unity and you can use GitHub - dkrprasetya/simple-firebase-unity: Firebase Realtime-Database's REST API Wrapper for Unity in C# with it. It uses the Firebase REST API to access the Firebase Database.

1 Like

I just released an asset that enables you to use firebase on webgl. Authentication is included.