[](LICENSE)
npm install o2-auth-fb-service
bash
$ npm install o2-auth-fb-service --save
`
Step by Step Installation of a demo program based on Angular/CLI
$3
Make your some directory for testing and change into the directory.
`bash
$ md test
$ cd test
`
Next run git clone like this.
`bash
$ git clone https://github.com/Ohtsu/o2-auth-fb-service-demo.git
$ cd o2-auth-fb-service-demo
$ npm install
`
$3
Of course you need to have Firebase account and your own project. If you don't have the account, visit the following page in advance and make your own project.
You need to get Firebase config data from your own project page. This url is as follows.
_https://console.firebase.google.com/project/your-project-name/overview_
You need the following parameters
- apiKey
- authDomain
- databaseURL
- storageBucket
- messagingSenderId
In "Overview" page, click Web Application icon.
Then those parameters above will be shown. Copy them.
$3
Change directory to "src/app/environments".
`bash
$ cd src/app/environments
`
You will find environment.ts and environment.prod.ts. Modify these files as follows. In firebaseConfig, paste the data above.
`bash
export const environment = {
production: true,
// Add Start --------------------------------------------
firebase: {
apiKey: '"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
authDomain: 'xxxxxxxxxxxxxxxxxx.firebaseapp.com',
databaseURL: 'https://xxxxxxxxxxxxxxxxxx.firebaseio.com',
projectId: 'xxxxxxxxxxxxx',
storageBucket: 'xxxxxxxxxxxxx.appspot.com',
messagingSenderId: 'xxxxxxxxxxxxxxxxxxxxx'
}
// Add End --------------------------------------------
};
`
$3
If you want to use the 3rd party authentications such as Google, Facebook, Twitter and GitHub, you need add login methods in Firebase Authentication page.
Set the target login method _enable_ in the status.
$3
If you start local server as follows, you can get the home page in your browser by accessing http://localhost:4200.
`bash
$ ng serve
``