This repository contains a demo application which shows how to use Firebase Authentification service in a web application. All of the Firebase calls implemented with pure Firebase API, without any 3rd party libraries
- Clone the repository
- Run
npm install
inside the project folder - Connect the application to Firebase (see "Connection to Firebase" section below).
- Run
npm start
into terminal and play with the demo on http://localhost:8080
-
Go to Firebase Console
-
Create new Firebase project.
-
In the Project Overview, click Add Firebase to your web app. It causes a popped up dialog within JavaScript snippet contains Firebase initialization parameters for your application. Something similar to this:
4. Copy the config object
```js
var config = {
apiKey: "apiKey",
authDomain: "projectId.firebaseapp.com",
databaseURL: "https://databaseName.firebaseio.com",
storageBucket: "bucket.appspot.com",
};
- Open
scripts/app.js
file and replace theconfig
object in it (lines 33-39) with the copied one. - Add
127.0.0.1
to the list of authenticated domains (see Domain authentication section below).
- In the menu of your Firebase project, select Auth
- Switch to SIGN-IN METHOD tab
- Scroll down to the **OAuth redirect domains ** section.
- Press ADD DOMAIN button and enter the domain (
127.0.0.1
) in the popped up window.