1
I need some help with good practice in using the Firebase on a project SPA, in my case the Angular.
I’m taking a development course with Angular 4 and in the topic regarding the use of Firebase as the back-end of the application the implementation of the authentication in the Angular. In the course is used the option "Add Firebase to your web application", which generates the code below.
var config = {
apiKey: "<api key>",
authDomain: "<authDomain>",
databaseURL: "<databaseURL>",
projectId: "<projectId>",
storageBucket: "<storegeBucket>",
messagingSenderId: "<messagingSenderId>"
};
firebase.initializeApp(config);
How the application is SPA this data goes to the client. Is there no risk of someone capturing the data to develop a fake page and misuse the resources? How do I use Firebase in a project SPA? It is safe to use the client’s direct connection to Firebase or need to develop a middleware to mediate this communication?
Only you don’t put this data on github in a public repository for example. By angular be compiled the files generated by it already comes configured with the right keys without need
– Eduardo Vargas
Eduardo. The compilation generated by Angular is not completely safe. Just do a more "malicious" analysis on the code generated by the build that we can extract the information chapadas in code.
– anderson macedo