Download the PHP package firevel/firebase-authentication without Composer
On this page you can find all versions of the php package firevel/firebase-authentication. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download firevel/firebase-authentication
More information about firevel/firebase-authentication
Files in firevel/firebase-authentication
Package firebase-authentication
Short Description Firebase authentication driver for Laravel
License MIT
Informations about the package firebase-authentication
Laravel Firebase Authentication
A robust Firebase Authentication API driver for Laravel and Firevel.
Introduction
Laravel Firebase Authentication provides a sophisticated firebase guard for user authentication via the Firebase Authentication JWT token. This allows you to securely authenticate users in your Laravel or Firevel applications, leveraging the power of Firebase Authentication.
Getting Started
Follow these steps to get started with Laravel Firebase Authentication.
Installation
Begin by installing the package using composer with the command:
Standard Configuration
-
Update
config/auth.php
: Specify Firebase as the authentication driver for your application. - Set Firebase project name: Configure your firebase project by adding
GOOGLE_CLOUD_PROJECT
to your environment variables or set thefirebase.project_id
config variable. - Update your
User
model: IntegrateFirevel\FirebaseAuthentication\FirebaseAuthenticable
trait, set$incrementing = false
and define$fillable
.
Below are examples of how to update your User model for Eloquent and Firequent:
Eloquent
Firequent
- Update Migration for users table: If you're using Eloquent, you'll need to manually create or update the migration for the users table.
Micro-service Configuration
To avoid sharing users database credentials between micro-services, the recommended configuration differs slightly:
-
Update
config/auth.php
: Specify Firebase as the authentication driver for the 'api' guard. - Update User Provider: In the
config/auth.php
file, define the user provider to use theFirevel\FirebaseAuthentication\FirebaseIdentity
model.
Web Guard Usage
To utilize firebase authentication within your web routes, it is necessary to attach the bearer token to each HTTP request.
The bearer token can be stored in the bearer_token
cookie variable. To do this, add the following to your Kernel.php
:
If the EncryptCookies middleware is in use, the following settings must be applied: