Cross-platform app showing how to register and loggin with email or social media from firebase.
- Angular 7+
- Ionic 4+
- Firebase
git clone https://github.com/victorjatoba/tuto-fire-angular-ionic-authentication.git
- Go to repository directory
- run:
$ npm i
- Create Firebase database;
- Acess the database;
- Click on "Add Firebase to your web app";
- Copy config values only. Example:
<script src="https://www.gstatic.com/firebasejs/5.8.4/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AI...ug",
authDomain: "your-database-name.firebaseapp.com",
databaseURL: "https://your-database-name.firebaseio.com",
projectId: "your-database-name",
storageBucket: "your-database-name.appspot.com",
messagingSenderId: "999999999999"
};
firebase.initializeApp(config);
</script>
See the link bellow with more details how to obtained this credentials. @see https://www.appypie.com/faqs/how-can-i-get-api-key-auth-domain-database-url-and-storage-bucket-from-my-firebase-account
- Create directory security on the src project.
src/security
- create file firebase-config.json
- Paste config values from step 2 onto firebase-config.json file.
- Apply json pattern. The firebase-config.json may be just like:
{
"apiKey": "AI...ug",
"authDomain": "your-database-name.firebaseapp.com",
"databaseURL": "https://your-database-name.firebaseio.com",
"projectId": "your-database-name",
"storageBucket": "your-database-name.appspot.com",
"messagingSenderId": "999999999999"
}
- Go to Firebase console;
- Open your database;
- Go to Authentication;
- Click on "sign in method" tab;
- Enable Google, Facebook and Twitter accounts.
run: $ ionic serve
Victor Jatobá – @victorjatoba10 – victorjatoba10[at]gmail.com
Distributed under the MIT license. See LICENSE
for more information.
https://github.com/victorjatoba/
- Fork it (https://github.com/victorjatoba/tuto-fire-angular-ionic-authentication/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
- http://jasonwatmore.com/post/2018/11/16/angular-7-jwt-authentication-example-tutorial#error-interceptor-ts
- https://www.appypie.com/faqs/how-can-i-get-api-key-auth-domain-database-url-and-storage-bucket-from-my-firebase-account
- https://www.positronx.io/full-angular-7-firebase-authentication-system/
- https://firebase.google.com/docs/auth/admin/