nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
641 stars 99 forks source link

How to use signInWithCustomToken with this module and authenticate firebase write request. #509

Closed PrajapatiDhara1510 closed 3 years ago

PrajapatiDhara1510 commented 3 years ago

Here is my feature. My authentication is done from the server and it gives me a token. I have few tables in my firebase database so I don't require the user should log in from the firebase default authentication. Because of the securing firebase rules, I need users to be authenticated. I searched and found that using signInWithCustomToken I can achieve it. But I didn't found a document on how to use it. But remember my main auth is server-based. I only need this for the writing some data to database.

Can anyone please guide me? Also If this is used then when I update the database is it going to pass logged in user auth so my security rule can pass the request. Here is security rule.

allow read, write: if request.auth != null;

tibs245 commented 3 years ago

I think don't understand. But I can try suppose.

You want that a user can send read/write request to firestore directly after personnalized server connection ?

If yes :