{"id":18615066,"url":"https://github.com/andrewjbateman/angular-firebase-auth-service","last_synced_at":"2025-09-20T09:53:48.722Z","repository":{"id":39885291,"uuid":"162041547","full_name":"AndrewJBateman/angular-firebase-auth-service","owner":"AndrewJBateman","description":":clipboard: Firebase user authentication service, tutorial from Stephen Fluin, Demos with Angular","archived":false,"fork":false,"pushed_at":"2023-02-02T20:34:29.000Z","size":2057,"stargazers_count":10,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T11:16:59.247Z","etag":null,"topics":["angular","angular15","firebase","firebase-authentication","firebase-database","firebase9","google-firebase","html5","real-time","rxjs","rxjs7","tutorial-code","typescript4"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-16T21:14:13.000Z","updated_at":"2024-08-30T21:37:03.000Z","dependencies_parsed_at":"2023-02-18T00:16:23.492Z","dependency_job_id":null,"html_url":"https://github.com/AndrewJBateman/angular-firebase-auth-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/angular-firebase-auth-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-firebase-auth-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-firebase-auth-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-firebase-auth-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-firebase-auth-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/angular-firebase-auth-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fangular-firebase-auth-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276077894,"owners_count":25581305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular15","firebase","firebase-authentication","firebase-database","firebase9","google-firebase","html5","real-time","rxjs","rxjs7","tutorial-code","typescript4"],"created_at":"2024-11-07T03:28:00.606Z","updated_at":"2025-09-20T09:53:48.668Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"TypeScript","readme":"# :zap: Angular Firebase Auth Service\n\n* User authentication app using Angular and google Firebase.\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/angular-firebase-auth-service?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/angular-firebase-auth-service?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/angular-firebase-auth-service?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/angular-firebase-auth-service?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Angular Firebase Auth Service](#zap-angular-firebase-auth-service)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* This is just for development, not production, so the whole firebase module is used.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/user-logged-in.png).\n\n## :signal_strength: Technologies\n\n* [Angular v15](https://angular.io/)\n* [Firebase v9](https://firebase.google.com/)\n* [Reactive Extensions for Javascript -RxJS v7](https://angular.io/guide/rx-library) library used for reactive programming using the observable type.\n* [RxJS SwitchMap](https://www.learnrxjs.io/learn-rxjs/operators/transformation/switchmap) On each emission **the previous inner observable is cancelled and the new observable is subscribed**; switch to a new observable. Only one subscription at a time - seems ideal for login applications\n\n## :floppy_disk: Setup\n\n* Install dependencies with `npm i`\n* Create google firebase project with `Sign-in provider` as Google and paste access keys from `Project Settings` into `environment.ts`\n* Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files\n\n## :computer: Code Examples\n\n* _user.service_ file\n\n```typescript\n@Injectable({\n  providedIn: 'root'\n})\nexport class UserService {\n  uid = this.afAuth.authState.pipe(\n    map(authState =\u003e {\n      if (!authState) {\n        return null;\n      } else {\n        return authState.uid;\n      }\n    })\n  );\n  //test to see if already logged in\n  isAdmin: Observable\u003cboolean\u003e = this.uid.pipe(\n    switchMap(uid =\u003e {\n      if (!uid) {\n        return observableOf(false);\n      } else {\n        return this.db.object\u003cboolean\u003e('/admin/' +uid).valueChanges();\n      }\n    })\n  );\n  //test to see if user has specific permissions\n  constructor(private afAuth: AngularFireAuth, private db: AngularFireDatabase) { }\n  login() {\n    this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider());\n  }\n  logout() {\n    this.afAuth.auth.signOut();\n  }\n}\n```\n\n## :cool: Features\n\n* user login using google id or password, can be viewed on Firebase Console.\n* User privileges can be revoked from the Firebase console.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working\n* To-Do: add theme colors and functionality. A bootstrap button would be better.\n\n## :clap: Inspiration\n\n* [Demos With Angular: Building A User Authentication Service with Angular and Firebase](https://www.youtube.com/watch?v=mfONkAj4x94).\n\n## :file_folder: License\n\n* This project is licensed under the terms of the MIT license.\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-firebase-auth-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fangular-firebase-auth-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fangular-firebase-auth-service/lists"}