MongoDB.live, free & fully virtual. June 9th - 10th. Register Now MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Firebase Authentication with Realm Cloud

I am trying to use Firebase Authentication because username/password authentication is no longer recommended. The documentation says I have to get a public/private key pair (not sure what settings I should use). I need to call the private key with fs.readFileSync(’pathToMyPrivateKeyFile’);
Which gives me an error “no such file or directory”.
I tried to use the absolute path and I tried to copy the key file in the func directory. Nothing works for me.

Hi! I wrote the guide…

For the keys, just use the default settings. It’s fine. More information can be found here https://www.ssh.com/ssh/keygen/.

An absolute path wont work. Personally I have placed the key file in the root folder for the firebase cloud functions and then simply use the filename as the path provided to fs.readFileAsync. No such file or directory simply means you didn’t get the path right.

Hope this helps!

BTW… if any realm mods are reading this… where is the Realm swag I was promised for writing the article 2 years ago? :wink:

Hi @Simon_Persson,

Sorry to hear your promised swag didn’t arrive. Can you send me a private message with more details on the arrangement so I can follow up?

Thanks,
Stennie

Hi Stennie! I don’t see a way to message you privately on these forums? Do you have an email I can reach out to?

//Simon

Hi Simon,

Private messaging is available for users of trust level 1 or higher (which you are).

If you click on my username you should see a green button for “Message”. There are also messaging options if you visit your own user profile page.

I’ll send you a note to get things started :slight_smile:.

Regards,
Stennie