1
votes

I've created a form in angular where users can enter some data. These users don't need to authenticate in order to use this form. So technically every user that calls this online form is able to send data.

As Firebase is being used as backend, I need to somehow authenticate my angular project with it. I don't want to allow read / write operations to everyone, so there must be some sort of minimum auth.

Now I know I could enable email/password authentication, and store these credentials for my app, but this somehow seems quite cheesy.

Is there a more elegant solution to this?

Thanks

EDIT:

I'm authenticating via email/password now. So I've created email/password credentials in firebase console, and use these in my application to authenticate. Thanks to all.

2
Why you don't want to allow read / write operations to everyone if you want to let everyone to read and write data into the db? Is it somehow bad / unsafe? - Julius
Well, the form contains empty fields when it starts up. So all data is being hidden from the users. And I intended to keep it like this so the user is just able to enter new data. However, my application needs to perform some additional read queries under the hood. - user2549803

2 Answers

1
votes

Make use of Firebase Authentication Via Google or Facebook etc.. Check this page for reference.

The prerequisites you need to set this up in Angular

A Full Working Example.

You can also find link to that code over in that page

0
votes

I don't exactly understand what you want. You want authenticated access but don't want email/password or federated (Google, Facebook, etc) sign in. Why not use anonymous sign-in then? With anonymous sign-in you also have the ability later to upgrade the user to non-anonymous if that is needed later on.